home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / bbskt30a.zip / BBSKIT.DOC next >
Text File  |  1993-11-10  |  196KB  |  5,107 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                              BBSkit
  26.                            Version 3.0
  27.                                 
  28.                      Communications Toolkit
  29.                       for Turbo Pascal 6.0
  30.                                 
  31.                          by Steve Madsen
  32.                                                         Copyright
  33.                                                                  
  34. BBSkit, associated utilities, source code, and documentation are
  35. copyright (c) 1991-93 by Steven Madsen.  All rights reserved.  No
  36. part of this publication may be reproduced, stored in a retrieval
  37. system, or transmitted, in any form or by any means, electronic,
  38. mechanical, photocopying, recording or otherwise, without the
  39. prior written permission of the author.  No patent liability is
  40. assumed with respect to the use of the information contained
  41. herein.  While every precaution has been taken in the preparation
  42. of this manual, the author assumes no responsibility for errors
  43. or omissions.
  44.  
  45. Other brand and product names are trademarks or registered
  46. trademarks of their respective holders.
  47.                                                 License Agreement
  48.                                                                  
  49. THIS SOFTWARE IS PROVIDED TO YOU SUBJECT TO THE TERMS AND
  50. CONDITIONS OF THIS AGREEMENT.  IN THE EVENT THAT YOU CANNOT
  51. ACCEPT THESE TERMS AND CONDITIONS, YOU MUST DESTROY THIS SOFTWARE
  52. WITH ALL DOCUMENTATION, INCLUDING THIS AGREEMENT, WITHIN 30 DAYS.
  53. YOU MUST ALSO DESTROY ANY ADDITIONAL COPIES YOU HAVE MADE FOR
  54. ARCHIVAL PURPOSES.
  55.  
  56. BBSKIT IS DISTRIBUTED AS SHAREWARE, WHICH MEANS YOU ARE GRANTED
  57. A 30 DAY LIMITED LICENSE IN WHICH TO TRY THE TOOLKIT OUT AND
  58. DECIDE IF IT IS SOMETHING YOU WILL CONTINUE TO USE.  PAST THIS
  59. 30 DAY LICENSE, YOU ARE EXPECTED TO REGISTER THE TOOLKIT, OR
  60. DESTROY ALL COPIES YOU HAVE MADE.
  61.  
  62. THE AUTHOR, STEVEN MADSEN, IS NOT RESPONSIBLE FOR ANY DAMAGES
  63. WHICH OCCUR THROUGH THE USE OF BBSKIT OR ANY OF ITS ASSOCIATED
  64. UTILITIES.  BY USING THIS TOOLKIT, YOU HAVE ACCEPTED
  65. RESPONSIBILITY FOR YOUR ACTIONS AND ANYTHING WHICH COMES OF THOSE
  66. ACTIONS, INCLUDING DAMAGES TO HARDWARE THAT YOU OWN.  USE THIS
  67. SOFTWARE AT YOUR OWN RISK.
  68.                                 Chapter 1: Introduction to BBSkit
  69.                                                                  
  70.  
  71. About this manual
  72.  
  73.      Welcome to BBSkit 3.0!  Thank you for supporting the
  74. shareware concept in registering this package.  I hope you will
  75. find that BBSkit is the most powerful, easy to use toolkit
  76. available for interfacing to a serial port for your Turbo Pascal
  77. applications.  Many long hours of hard work have gone into making
  78. BBSkit a well-written and well-documented package, and I hope
  79. your learning curve is a short one.
  80.  
  81.      If you have never used objects before, please take the time
  82. to read the first few chapters of this manual.  They will provide
  83. some useful hints on what you're getting yourself into when
  84. combining telecommunications and the mysteries of the object
  85. oriented paradigm.
  86.  
  87.      The following tools were used to create BBSkit and the
  88. documentation:
  89.  
  90.        * Borland Pascal v7.0 from Borland International
  91.        * Turbo Assembler v3.2 from Borland International
  92.        * Microsoft Word for Windows v2.0c
  93.  
  94. Style conventions
  95.  
  96.      This manual will make use of some style conventions
  97. throughout the text which you should be aware of.  Some of this
  98. text is merely for information, while other text may mean serious
  99. trouble for certain situations.
  100.  
  101.           Indented text shows something that will appear on your
  102.           screen, example program text, or text your should type
  103.           into your computer.
  104.  
  105. The purpose of BBSkit
  106.  
  107.      Ever since I became involved with telecommunications in the
  108. mid 1980's, I have been very interested in writing applications
  109. that work with the serial port.  Particularly, I like writing
  110. bulletin board systems.  The only problem was that I found no
  111. communications packages that met my standards, which included
  112. being usable under Turbo Pascal.  Thus, BBSkit was born.
  113.      My main idea in creating BBSkit was to provide the most
  114. seamless environment for a BBS author to create his or her
  115. application.  BBS and door applications are complex things,
  116. requiring a level of attention to detail that might not
  117. immediately leap to mind.  BBSkit takes most of the hassle of
  118. coding the menial parts of a BBS or door and provides it in a
  119. much easier to use object environment.
  120.      Think of BBSkit as a shell program.  Everything you need to
  121. use your modem or communicate through your serial port is already
  122. there.  You can route input and output, send and receive files,
  123. and emulate over 10 different terminals.  Now you can concentrate
  124. on writing your application, not on communicating with your
  125. serial port.
  126.  
  127. What's new in version 3.0?
  128.  
  129.      Just as version 2.0 of BBSkit was a tremendous improvement
  130. over 1.0, version 3.0 will add lots of new features you'll wonder
  131. how you got along without!  Concurrent port support has been
  132. added.  Now BBSkit makes it possible to write a two (or more)
  133. line bulletin board that runs off of a single CPU.  To make
  134. concurrent port support easier to use, BBSkit has been changed to
  135. use virtual consoles (VCs), which act just like your text screen.
  136. Now each time you create a new object from the one provided with
  137. BBSkit, it brings a VC with it.  Anything that object wants to
  138. write to the screen goes to the VC, and only gets displayed when
  139. you want to see that console.  Otherwise it happily works in the
  140. background.  How does BBSkit allow multiple nodes?  It integrates
  141. a public domain unit called MTASK, which gives TP programs the
  142. ability to multithread, or have multiple threads of processing
  143. running at the same time.  BBSkit has been prepared to
  144. automatically switch among these threads, giving the illusion of
  145. multitasking to your BBSkit applications.  The primary advantage
  146. is that your single line systems can have a remote user on at the
  147. same time that you can use the system _ no more waiting for a
  148. user to get off just to use your BBS!  Best of all, this
  149. functionality comes without the overhead of a dedicated
  150. multitasking system such as Windows or DESQview.
  151.      Some users of BBSkit 2.0 have asked about the possibility of
  152. adding either RIP or NAPLPS to an upcoming version of BBSkit.  I
  153. am aware of these graphical protocols, and am considering the
  154. possibility of adding them in the future.  For now, however, BSP
  155. will remain as the only graphics/mouse protocol in BBSkit.  It
  156. will most likely see some work in the future, but that's another
  157. story...
  158.      Finally, Internet users will be very happy to hear about the
  159. addition of a mailing list and ftp site just for BBSkit.  See
  160. appendix B for more information.
  161.  
  162. Thanks to...
  163.  
  164.      I'd like to take this time to thank some people who have
  165. helped bring version 3.0 to life with their own contributions of
  166. bug reports, encouragement, praise and the occasional smack to
  167. the head when I wasn't thinking:
  168.  
  169.           Alain Abdul Sater
  170.           James Farley
  171.           Scott Hunt
  172.           Dave Nims
  173.           Caj Rosenqvist
  174.           James Still
  175.  
  176.      Thanks, everyone, for supporting me in the last year.  This
  177. toolkit has evolved far more than I thought possible.  When you
  178. crank out your next killer BBS or door, drop me a note so I can
  179. check out your work!
  180.                                 Chapter 2: Telecommunications 101
  181.                                                                  
  182.  
  183. What exactly is telecommunications?
  184.  
  185.      Telecommunications can mean different things, but in the
  186. computer world is generally means connecting to another computer
  187. by using your computer and modem.  Telecommunications always
  188. starts with someone dialing someone else up over the phone lines
  189. for a specific purpose.  This purpose might be to download a
  190. file, send a message to a friend, play a game, or even read stock
  191. quotes on an information service.
  192.      To the casual user, telecommunications probably seems pretty
  193. simple, but in reality the programmer has a lot of information to
  194. deal with, and a lot of little things to take care of, all while
  195. dutifully serving the users needs and desires.
  196.  
  197. The hardware
  198.  
  199.      Every IBM PC and compatible that has a serial port is based
  200. on some version of the National 8250 UART.  The 8250 will handle
  201. the basic functions of serial input and output: sending and
  202. receiving characters, keeping track of the status of the line,
  203. and keeping track of the status of the modem.
  204.      Early chips such as the 8250 could only reach speeds of
  205. 38,400bps.  Newer chips such as the 16450 and 16550A can reach
  206. speeds of 115,200bps with a machine fast enough to handle the
  207. interrupts.
  208.      The serial cable which connects your modem to your computer
  209. is comprised of several wires, one for each of the pins that deal
  210. with serial communications.  These wires carry signals from the
  211. serial port to the modem, and vice versa, which affect what
  212. things happen and when.  For example, if your modem is connected
  213. to another modem, you are connected and a carrier is present.
  214. When a carrier is detected by the modem, it will hold the DCD
  215. (data carrier detect) line high to indicate this to the serial
  216. port.  Your program, in turn, can check the serial port for the
  217. status of DCD.  If the corresponding DCD bit is set, then you are
  218. connected.  Thus, it is very easy for your program to find out
  219. what is happening with the modem simply by checking the serial
  220. port registers.
  221.      Some of the more recent versions of the 8250 include the
  222. 16550 and the 16550A.  Essentially the two are the same, but the
  223. 16550 has some bugs and should be treated as a 16450.  The reason
  224. that special mention is made of the 16550A is that it contains
  225. something called FIFO buffers.  FIFOs can improve the efficiency
  226. of data transmissions by providing a kind of holding area for
  227. characters that need to be sent or characters that have already
  228. been received.  BBSkit can make use of these FIFOs it they are
  229. detected on your serial port.  FIFO buffers are sometimes a
  230. necessity to reach the full potential of high speed modems.
  231. Additionally, if you are trying to run more than one serial port
  232. at a high speed (greater than 9600bps), FIFO buffers are a
  233. requirement for the computer to be able to keep up with the
  234. serial ports.
  235.  
  236. The software
  237.  
  238.      A bulletin board can be much more than just a hobby.  Some
  239. businesses use it as a means of contacting people that otherwise
  240. would not visit the store, or to provide additional service to
  241. already existing customers.
  242.      BBSkit was developed because there were no Turbo Pascal
  243. toolkits that I could find that would address all of the special
  244. needs of writing a BBS or door.  The programs provide very
  245. complex user interface.  It needs to deal with a human in a
  246. friendly way, it needs to be fast and efficient, and it needs to
  247. be attractive enough to make your BBS successful.  The toolkit
  248. itself needs to be written in such a way that users of the
  249. toolkit can expand it, change it, use it any way they want.  When
  250. I first began this project in earnest, only one thing came to my
  251. mind: objects.  Objects can provide the level of transparency
  252. that I desired for BBSkit.  In so doing, we can let the object do
  253. as much of the dirty work as possible, and let you concentrate on
  254. the creative aspect of your application (which is more fun
  255. anyway).
  256.                                Chapter 3: Introduction to Objects
  257.                                                                  
  258.      While reading this section, it is assumed that you are a
  259. fairly experienced Pascal programmer and know how to use records
  260. reasonably well.  It would also help to read the appropriate part
  261. of your Turbo Pascal documentation.  Chapter 4 (TP 6.0) or
  262. Chapter 9 (BP 7.0) of the User's Guide provides good material for
  263. someone just learning objects.  This chapter is not intended as a
  264. substitute for the Borland documentation, but instead as a
  265. supplement.  I feel that it is extremely important for you to
  266. know what the object oriented idea of programming is all about.
  267. It will only make your applications easier to debug and follow
  268. months down the road.
  269.      The only thing I'd like to say in advance is that objects
  270. are not in any way easy to pick up in a single hour.  You need to
  271. think in a totally different way, and their true value may not
  272. come until much later.  But read the information carefully, refer
  273. back to your Borland manuals, and by all means don't get
  274. frustrated.  It will make the difference in the long run.
  275.  
  276. What is an object?
  277.  
  278.      Think of a Pascal object just like any other object in our
  279. world.  It is defined by certain characteristics and serves some
  280. purpose.  A Pascal object is much the same.  It contains data in
  281. the form of variables (the characteristics), but it also contains
  282. the procedures and functions to do something with that data (the
  283. purpose).  The best way to think of an object is to give an
  284. example that is reasonably common for most Pascal programmers.
  285. I'll use the linked list as an example throughout the rest of
  286. this section.
  287.      The typical definition of a linked list will look something
  288. like this:
  289.           
  290.           Type
  291.             PNode = ^TNode; { pointer to a node in list }
  292.             TNode = record
  293.               Data: Integer; { data to stored in the list }
  294.               Next: PNode; { pointer to next node }
  295.             end;
  296.           
  297.           Var
  298.             List: PNode; { points to the first node }
  299.           
  300.           PROCEDURE Create(var Head: PNode);
  301.           PROCEDURE Delete(var Head: PNode; Data: Integer);
  302.           FUNCTION InList(Head: PNode; Data: Integer):
  303.                Boolean;
  304.           PROCEDURE Insert(var Head: PNode; Data: Integer);
  305.           FUNCTION IsEmpty(Head: PNode): Boolean;
  306.           
  307.      In this example, the record type TNode is one node in our
  308. list, which can be a different length every time we check it.
  309. (That's that point of a linked list, after all.)  This node
  310. contains two variables, the first of which is our data, and the
  311. second of which is a pointer to the next node, which also has a
  312. piece of data as well as another pointer.  This will continue
  313. until a node has a pointer of nil value, which means we are at
  314. the end of our list.  This list is operated on by the three
  315. procedures and two functions which follow the Type and Var
  316. sections in the example above.  The procedure Create will
  317. initialize a linked list so it can be used by the other
  318. procedures and functions.  Delete will delete the node whose data
  319. value matches the Data variable passed to it.  InList returns a
  320. boolean variable which reports whether or not a piece of data
  321. exists in the list.  Insert will insert a new piece of data (and
  322. therefore a new node) into the list, sometimes maintaining some
  323. sort of order.  IsEmpty returns the empty status of the list (if
  324. there are no nodes, then this is true).
  325.      Now, to realize the potential that objects have for a linked
  326. list, imagine being able to combine both the data for the linked
  327. list (the variable List) and the procedures and functions which
  328. operate on it.  The object form of our linked list would look
  329. much like the original version, but with a few subtle
  330. differences:
  331.           
  332.           Type
  333.             PNode = ^TNode; { pointer to a node in list }
  334.             TNode = record
  335.               Data: Integer; { data to be stored in list }
  336.               Next: PNode; { pointer to the next node }
  337.             end;
  338.           
  339.             TList = object
  340.               List: PNode;
  341.           
  342.               CONSTRUCTOR Init;
  343.               DESTRUCTOR Done;
  344.               PROCEDURE Delete(Data : Integer);
  345.               FUNCTION InList(Data : Integer) : Boolean;
  346.               PROCEDURE Insert(Data : Integer);
  347.               FUNCTION IsEmpty : Boolean;
  348.             end;
  349.           
  350.           Var
  351.             List: TList; { our linked list }
  352.           
  353.      What has changed?  Well, the most obvious change is that the
  354. procedures and functions have been moved into the Type
  355. definition.  What we have done with this move is encapsulated our
  356. code and data in one entity: the object!  About the only thing
  357. that seems to be a benefit from this move is that our procedures
  358. and function (also known as methods since they are part of an
  359. object) do not require a parameter of type PNode to be passed to
  360. them.  When you call one of these methods, they already know
  361. exactly which list you are talking about, even if you have
  362. hundreds of them in your application.
  363.      Writing such data types as objects also has one other
  364. benefit.  Several abstract data types (or ADTs), such as the
  365. linked list, the queue and the stack, have several procedures or
  366. functions common among them all in name or purpose, but they must
  367. do each operation slightly different.  So, when you name these
  368. procedures or functions in a non-object implementation, you must
  369. prefix each with a name such as ListCreate or QueueCreate.  When
  370. you turn these ADTs into objects, you just name the procedure
  371. Create in every object and let the compiler handle it from there.
  372. Once you get the code debugged and it works, you need only know
  373. that a Create procedure creates some sort of data type.  It
  374. really doesn't matter which one because they all do pretty much
  375. the same thing: create an ADT and initialize it for use.
  376.  
  377. How do objects fit into BBSkit?
  378.  
  379.      All of this must seem pretty pointless.  How do objects make
  380. programming a BBS any easier?  Well, there are two important
  381. things left out of the preceding section: inheritance and
  382. polymorphism.
  383.  
  384. Inheritance
  385.  
  386.      Let's say we want to expand our linked list from the
  387. previous section to do a couple more things.  It really doesn't
  388. matter what these things are, just the fact that we want the link
  389. to function exactly like the old list with the exception of our
  390. new code.  Now, rather than rewriting all of that old code, or
  391. copying the text (which is still the same as rewriting it as far
  392. as compiled code is concerned), wouldn't it be great to just tell
  393. the compiler that we want to use the old list as a base to build
  394. on?  Well, we can!
  395.           
  396.           Type
  397.             TNewList = object(TList)
  398.               PROCEDURE WowMe;
  399.             end;
  400.           
  401.      This definition does exactly what we just talked about.  It
  402. creates a new object that descends from a previously defined type
  403. and adds one method to it.  Now, variables of type TNewList can
  404. access all of the stuff in TList as well as procedure WowMe.  The
  405. only code we have to write is for our new method.  Everything
  406. else is already written, already debugged, already there.  Turbo
  407. does the rest.
  408.  
  409. Polymorphism
  410.  
  411.      We can write an object and add to it without changing the
  412. original definition.  But what if we want our descendant object
  413. to inherit some method that we want to change slightly?  What if
  414. we even want to be able to still call the old code?  This is
  415. where BBSkit and objects truly become useful.
  416.      To polymorph a method of some object, some small changes
  417. needs to be made to the code.  Unfortunately, this requires
  418. having the source code to the object you wish to change.  For
  419. this reason, if you ever think that you might need to override a
  420. method, design your object accordingly.
  421.      Before anything can be polymorphed, two very important
  422. things have to be written into your code that wouldn't normally
  423. be there: the CONSTRUCTOR and DESTRUCTOR methods.  Constructor
  424. methods do what you would expect them to: they construct an
  425. object for use.  More specifically, they set up the object's
  426. virtual method table, or VMT.  The VMT is how the compiler keeps
  427. track of which methods have been overridden and which haven't, so
  428. when your object calls a method it knows where the code really
  429. is.
  430.       If  you  don't  call the constructor and you  have  virtual
  431. methods  in  your  object, your system can  completely  lock  up.
  432. Always call the constructor before any other method.
  433.      The keyword virtual will tell the compiled that the method
  434. might need to be overridden sometime, somewhere.  Place it after
  435. any method that might be overridden like this:
  436.           
  437.             TList = object
  438.               List : PNode;
  439.           
  440.               CONSTRUCTOR Init;
  441.               DESTRUCTOR Done; virtual;
  442.               PROCEDURE Delete(Data : Integer);
  443.               FUNCTION InList(Data : Integer) : Boolean;
  444.               PROCEDURE Insert(Data : Integer); virtual;
  445.               FUNCTION IsEmpty : Boolean;
  446.             end;
  447.           
  448.      In this example, the Done method and the Insert method have
  449. become virtual.  Why?  What if you need to add some dynamic
  450. variables to a descendant of this object, and they need to be
  451. disposed of when the object is disposed?  Dispose of them in the
  452. destructor and you will never have to worry about the variables
  453. being "lost."  As for the Insert method, you may want to create a
  454. descendant object which sorts the list contents as they are
  455. inserted.  It is only logical to place such code in the Insert
  456. method.
  457.      Also remember that once a method is declared virtual, it
  458. must always be declared virtual in the descendant objects as
  459. well.  As the Turbo manual say, "once virtual, always virtual."
  460.      You can still override non-virtual methods, and the compiler
  461. will  not  give  you an error.  These methods, however,  are  not
  462. virtual, and the new object cannot call the old method, only  the
  463. new.   Use  caution  when overriding methods and  make  sure  the
  464. parent method is virtual if you still want to use it.
  465.  
  466.      The last thing to keep in mind is that the procedure Run has
  467. become pretty standard with the introduction of Turbo Vision.
  468. Run is pretty much a "do-all" procedure that repeats itself over
  469. and over until the application is ready to be quitted.  If you've
  470. read the Turbo Vision manual, or even just parts of it, you will
  471. probably recognize that this is the main part of almost every
  472. Turbo Vision program:
  473.           
  474.           BEGIN
  475.             App.Init;
  476.             App.Run;
  477.             App.Done;
  478.           END.
  479.           
  480.      In this case, the Init method initializes the program and
  481. all the variables to whatever state they need to be in at the
  482. programs start.  Done does exactly the opposite; it prepares the
  483. program for quitting by closing all open files and freeing up all
  484. the memory that has been allocated for dynamic variables.  Init
  485. and Done are called only once, so it goes to show that Run must
  486. execute the rest of the time the program is running.  BBSkit also
  487. makes use of this so that some sort of standard might emerge.
  488.  
  489. Expanding the stock TBBS object
  490.  
  491.      The three methods which actually control the flow of a
  492. BBSkit program (Init, Done and Run) are all empty in the TBBS
  493. object.  Calling them is just like not calling them because there
  494. is nothing in them.  So, the first thing you need to do when you
  495. create a descendant of TBBS is to give these methods something to
  496. do.
  497.      Init should do whatever things you need done once only.
  498. Unless you can be assured that the modem will never need to be
  499. initialized more than once, setting up the modem is probably not
  500. the thing to do in here.  The only exception is to set the modem
  501. to auto answer using the ATS0=x command, where x is some integer
  502. number greater than zero.  Your should open the serial port here,
  503. and possibly read in any configuration stuff for your app and
  504. store them in variables in your object.
  505.      Done should do pretty much the opposite of Init.  Here
  506. should go all code to make sure your system shuts down correctly.
  507. Close all your open files, close down the serial port, make sure
  508. your dynamic variables are all deallocated and then return any
  509. exit code you might want to send to a batch file.  This method is
  510. also called only once during the execution of a program.  Done
  511. will also handle deallocation of your object.
  512.      Run is where your program will spend almost all of its time.
  513. Init and Done will take a very minor amount of time, so if your
  514. program runs for an hour, almost all of it will be spent in this
  515. method.  Coding approach is a little different for a BBS
  516. application and terminal applications, so I will cover each in
  517. more detail in chapters 4 and 5.  Some general things to remember
  518. are global for any application.  BBSkit is ideally suited for an
  519. event-driven application if you like writing those kinds of apps
  520. (which is what Turbo Vision is, by the way).  Run could simply be
  521. an event handler, which will call several other methods which
  522. actually get stuff done and then return a code telling Run where
  523. to go next.  This type of setup is also great for programs which
  524. want to use overlays, because you can place the code to do things
  525. in a separate unit and then turn those units into an overlay.
  526. This will save on memory and can help make a shell to the
  527. operating system more efficient.  BBS apps will especially
  528. appreciate this because they can make more memory available for
  529. on-line doors.
  530.  
  531. Important things to remember
  532.  
  533.      Objects are a new thing to a lot of people, so if you don't
  534. get it right away, be patient.  They are a radically different
  535. approach to programming and it may take a little while to get the
  536. idea of what objects are truly useful for.  Object oriented
  537. programming is a great way to get a lot done in little code
  538. because most of the work is already done.  Borland's manuals were
  539. a good source of information for me when I was learning objects,
  540. so if you haven't already read those, please do.  They will make
  541. more sense out of some of the topics I have discussed in this
  542. manual.  This manual should certainly not be used a substitute
  543. for Borland's documentation!  They designed the OOP additions to
  544. Turbo Pascal, so they will know what they're talking about better
  545. than I.
  546.                                             Chapter 4: BBS Design
  547.                                                                  
  548.  
  549. Principles of BBS design
  550.  
  551.      Bulletin boards are complicated beasts.  More and more often
  552. the small boards you know and love are slowly turning into power
  553. house systems with multiple lines, and extra benefits for users
  554. that contribute a little cash to the system.  These types of
  555. systems aren't just a hobby anymore, they can turn into a full
  556. time business, providing information service features for a lot
  557. less money.  It is for this reason that a BBS must be carefully
  558. handled.  In either case, there is a lot of time and money
  559. invested in a BBS, and there is no reason that it should fail
  560. because of a poor design.  BBSkit tries to do as much of the
  561. dirty work as possible, making sure that users don't exceed time
  562. limits, that they have an environment that works for them instead
  563. of them working around it.  You should carry this philosophy into
  564. designing your bulletin board system.  Sometimes KISS (keep it
  565. simple, stupid!) makes a whole lot of sense.
  566.      Any time you write a BBS, there are some things you should
  567. do before you code a single line.  Try to lay everything out
  568. ahead of time, making the most of your ideas on paper.  Lay out
  569. your data structures for your config files, user databases, file
  570. areas, message bases, everything.  If you have flags for security
  571. levels or just a level number, write down what will be standard
  572. for the flags or levels.  Write down what each subsystem of your
  573. BBS will do.  It might also be a good idea to write down what
  574. basic commands will be available from each of your subsystems.
  575.      Once you have this done, you are a little closer to getting
  576. down and writing code.  There are a few more things which need to
  577. be cleared up before you start, though.  Are you going to split
  578. your code into separate units, perhaps to create an overlaid BBS?
  579. Or, are you going to make one gigantic executable which will eat
  580. up just as much system memory?  For that matter, how much memory
  581. are you going to require for your system?  Will you be using an
  582. event-driven method of calling (such as Turbo Vision
  583. application), or are you going to do it some other way?  (Objects
  584. go hand in hand with event-driven programming, so this is
  585. something you should seriously consider.)
  586.      Perhaps the best way to prepare for writing a BBS is to
  587. closely examine a couple of different systems that have been
  588. successful in your area.  Call them up and explore them.  Find
  589. out what they do and how they handle things.  You'll notice
  590. things that might not immediately come to mind, such as time
  591. limits, color use, how fast their system really is, and maybe the
  592. way they manipulate their message base.  If you want you can even
  593. take the feature list from a couple of different systems, pick
  594. out what you like the best, maybe add to it, and then plan on
  595. implementing that in your app.
  596.  
  597. BBS design using BBSkit
  598.  
  599.      When designing your BBS using BBSkit, you will always want
  600. to override the stock TBBS object.  Overriding this object will
  601. enable you to access all of the special features contained in the
  602. object without having to modify the source code.  (See the
  603. chapter on objects for information on this subject.)  Your new
  604. object will provide the guts to your application, making use of
  605. the provided TBBS methods when needed.
  606.      New objects will need to override the Init, Done, and Run
  607. methods, but at the same time remember to call the old ones in
  608. order to keep things running smoothly.  Remember that the Run
  609. method should loop until you are ready for your program to return
  610. to DOS.  Whenever you return to DOS, it's a good idea (unless you
  611. know what you are doing!) to make absolutely sure that the serial
  612. port is closed down.  If it isn't, there is the slight
  613. possibility that incoming characters or changes in the serial
  614. port status lines will cause interrupts to occur when there is no
  615. code to handle them!
  616.  
  617. Menu loops
  618.  
  619.      Every board that hosts a user and performs various actions
  620. for that user must have a menu loop of some sort.  Most boards
  621. have multiple menus: one for the message section, one for the
  622. file section, one for online games, and possibly a "main" menu
  623. that will allow the user to go to any of the other major sections
  624. of the board.
  625.      However you code it, you may have lots of menu loops, or you
  626. could have one procedure that handles all the menus in the
  627. system.  Whichever the case, there are some very important things
  628. to remember before putting the finishing touches on your system.
  629. As the author of this system, you have to write code that will
  630. handle all sorts of stupid things that users do, like hanging up
  631. on your system suddenly, leaving the computer doing nothing for
  632. ten minutes (and thereby not allowing anyone else to use the
  633. system either) and staying on for excessive amounts of time.  The
  634. following segment of code should give you some idea of the stuff
  635. required in a menu loop.
  636.           
  637.           Var
  638.             LogOff : Boolean; { when true, log user off
  639.                                 system }
  640.             Ch     : Char;
  641.           
  642.           begin
  643.             LogOff := False;
  644.             while (not LogOff) do
  645.              begin
  646.                Repeat
  647.                  if (CarrierLost) or (UserInactive) then
  648.                     LogOff := True;
  649.                Until (LogOff) or (Incoming);
  650.                if (Incoming) then
  651.                 begin
  652.                   Ch := UpCase(ComReadKey);
  653.                   case Ch of
  654.                     'M' : MessageMenu;
  655.                     'F' : FileMenu;
  656.                     'G' : Games;
  657.                     'O' : LogOff := True;
  658.                   end;
  659.                 end;
  660.              end;
  661.           end;
  662.           
  663.      In this example, we have several things going on.  Our
  664. LogOff boolean simply tells the program if the user needs to be
  665. logged off the system for some reason.  This could be because he
  666. hung up on us, or his session is over, or because he specifically
  667. told the system that he was done for this call.  In any case,
  668. when LogOff becomes true, this code segment will be swiftly
  669. exited and the program must then handle shutting down this users
  670. session.  All other cases will find us within this menu loop,
  671. continually checking to see if the user is on or if his session
  672. is over, or if he pressed a defined key.  When a key is pressed
  673. that we know how to handle, the case statement directs us to the
  674. next part of the system.
  675.      UserInactive is a boolean function which returns true if a
  676. user inactivity has occurred.
  677.  
  678. Time limits
  679.  
  680.      Time limits are a good idea to have on any BBS.  This keeps
  681. users from taking up ridiculous amounts of time doing their own
  682. thing when other users are most likely anxious to get on
  683. themselves.  Generally, time limits will be a requirement for all
  684. users.
  685.      Time limits are already directly supported by BBSkit.  You
  686. need only tell the system how much time a user should have, and
  687. enable the timing system.  The rest is taken care of by BBSkit.
  688. When time expires, the system will treat it the same as an
  689. inactivity time-out.  You can check to see if there is any time
  690. left in the user's session to distinguish between a true
  691. inactivity and no time remaining.
  692.      Check the TBBS method SetTimeLimit for more information.
  693.  
  694. Front-end mailers
  695.  
  696.      This is a tricky subject.  Front-end mailers exist to port
  697. messages from world-wide networks into your own BBSes message
  698. bases.  Most of these mailers can write to a variety of the more
  699. popular message storage formats, such as the one used by QuickBBS
  700. and all of its clones.  However, this is not too important a
  701. topic to cover because the style of your message base is your
  702. decision.  Also, these mailers generally provide support to write
  703. messages to a generic format, which you can then convert to your
  704. own format using a custom written program.
  705.      More to the point, a front-end mailer will answer the phone
  706. for you, determine who is calling (is it a user or another
  707. computer ready to send messages?) and then only transfer control
  708. to your BBS if the caller is a user.  In this way, your BBS needs
  709. to set up some type of command line options that allow an outside
  710. program to tell the BBS what is happening.  For example, what bps
  711. rate did this new user connect at?  If the bps rates aren't
  712. matched, the end user will get a lot of garbage every time you
  713. attempt to send a character out to him or her.  Again, the best
  714. solution for this problem would be to look at another BBS that
  715. you see using a front-end mailer.  How does it get around this
  716. problem?  You can always borrow ideas from something that is
  717. "tried and true."
  718.      Front-end mailers generally require a FOSSIL driver for
  719. serial communications.  A future version of BBSkit will allow you
  720. to use a FOSSIL in place of the internal routines, making
  721. synchronization with mailers extremely easy.
  722.  
  723. Emulation
  724.  
  725.      Emulation has been around a long time in the BBS world, but
  726. even longer in the mainframe world.  It is also one of the best
  727. things to happen to telecommunications.  It's always nice to make
  728. a user feel at home, letting your BBS mimic some of the things
  729. that a PC can do by itself.  Emulation is a way of letting your
  730. computer tell a remote computer what to do.  Remember that
  731. straight telecommunications can only send and receive characters.
  732. There are no standard ways to tell the remote computer to place
  733. the cursor at a certain spot on the screen.  Only some sort of
  734. emulation provides this ability, and even then you have to decide
  735. what type of emulation to use, because all emulations are not
  736. created equal.
  737.      By far the most popular emulation in use by BBSes in the
  738. U.S. is ANSI, which is a derivative of DEC VT-100 with additional
  739. support for color and less application/mainframe specific codes.
  740. Any serious BBS needs to support ANSI, and BBSkit takes care of
  741. this nicely.  You need only load the template, and your program
  742. supports ANSI for send and receive.
  743.      Emulation lets you do a lot of neat things that you normally
  744. cannot do on a BBS.  Full screen editors, screen-oriented
  745. systems, full color games, and some other niceties would simply
  746. not exist without emulation.
  747.  
  748. Tricks and traps
  749.  
  750.      This section will just contain some final words on the topic
  751. of designing your BBS.  There are one or two things that will
  752. undoubtedly come up as a result of writing your BBS in Pascal,
  753. which is a procedural language, versus writing it in something
  754. such as BASIC, where your program can go anywhere it wants
  755. anytime it wants.  I wrote my first two boards in BASIC on an
  756. Apple II, and it was very easy to handle such things as carrier
  757. loss because I just told the code to "goto" if something went
  758. awry.  You can't get away with this type of thing in Pascal.
  759.      The easiest way to handle something where your code needs to
  760. bubble upwards to your Run procedure is to use a boolean variable
  761. of some sort.  Just check this at the beginning of each
  762. procedure, and only let that procedure execute if the boolean is
  763. of some predefined value (most of the time I'm guessing it will
  764. be false, for example if (not FatalError) or something like it).
  765. If this variable ever becomes the "wrong" value (in our example
  766. it would be true), the code will just end up bubbling back to the
  767. top, where we can easily handle anything bad that has happened.
  768. The three things that immediately come to mind are carrier loss,
  769. inactivity timeout and expiring time limit.  All of these will
  770. require some sort of handling just like this.  If you come up
  771. with a better way of doing this, by all means let me know and
  772. I'll put it in the next version of this manual!
  773.      Starting with version 3.0, a rather non-structured way of
  774. doing this would be to create two tasks using MTASK for each node
  775. in your system.  One task (we'll call it the system task) makes
  776. sure things are okay with carrier, time limits and such, while
  777. the other task (the interface task) does all the interfacing.  If
  778. something bad happens, the system task kills the interface task
  779. and drops out on its own.  Things still work out neatly, but
  780. debugging can be a bear.
  781.      Finally, just keep in mind that in writing BBSkit I've tried
  782. to keep everything easy to use.  If you have problems with
  783. anything, just override it or let me know what's going wrong and
  784. I'll try to fix it.  I can't promise anything, but I'll try.  I
  785. firmly believe that powerful, fast, easy to use boards can be
  786. written with a generic toolkit such as BBSkit.  If you get stuck,
  787. take a look at Host.Pas, provided on your distribution disk.
  788. It's a reasonably fleshed out host which can give you ideas on
  789. the basics of how a BBS should be approached.
  790.                                        Chapter 5: Terminal Design
  791.                                                                  
  792.  
  793. Principles of terminal design
  794.  
  795.      Designing a terminal program using a toolkit such as BBSkit
  796. may seem strange at first, but it can be done.  After all, the
  797. most important part of your program (the communications routines)
  798. are already written.  These routines don't care if your program
  799. is a host or a user because they still send and receive
  800. characters.  Additionally, the emulation routines are capable of
  801. maintaining some decent support for emulation unless you want one
  802. hundred percent mainframe compatibility with VT-100.  Two
  803. protocols and their derivatives are already included, so you are
  804. actually well on your way to creating a full featured terminal
  805. just by using the available tools.  The most important task for
  806. you is now to link these tools together by creating some sort of
  807. interface for the local user.  This is where BBS design and
  808. terminal design differ radically; they service opposite ends of
  809. the connection.  So, although most of the routines contained in
  810. BBSkit are meant for a BBS, this is only because a BBS requires
  811. more specific support routines.  A terminal does little more than
  812. send and receive characters are far as the remote host is
  813. concerned.  The rest of the time is spent dealing with the local
  814. user, and the remote host knows nothing about that.
  815.  
  816. Terminal design using BBSkit
  817.  
  818.      Again, one of the most important things to decide is what
  819. your terminal is going to offer.  Get all your ideas down on
  820. paper before you start working, otherwise you'll deadlock trying
  821. to add something later.  Design your menus, figure out what you
  822. will offer, and decide on a user interface.  Will the terminal be
  823. in text or graphics mode?  Are you going to be using a pre-
  824. written user interface such as Turbo Vision or are you writing
  825. your own?  Can this interface be used with BBSkit without severe
  826. conflicts?  (Remember that Turbo doesn't currently offer anything
  827. like multiple inheritance.  So, if you use two objects such as
  828. Turbo Vision and BBSkit together, one of them will have to be the
  829. primary object while the other takes a back seat.)
  830.  
  831. Getting local commands using TerminalMode
  832.  
  833.      Perhaps the easiest way to use BBSkit in terminal mode is to
  834. use the built in method TerminalMode.  TerminalMode is capable of
  835. providing basic terminal characteristics.  That is, it will send
  836. characters typed on the local keyboard to the serial port, and
  837. display characters received at the serial port on your screen.
  838. TerminalMode offers full, half, and "chat" duplex modes, as well
  839. as an option to display control characters instead of their
  840. sometimes-cryptic pictures that DOS uses.  TerminalMode will exit
  841. as soon as it gets an extended keypress from the local keyboard,
  842. and then return this keypress as the function result.  Thus, you
  843. can implement all Alt- combinations as well as PgUp, PgDn and all
  844. the other extended keys as local commands to your terminal
  845. program.
  846.      A menu loop for this type of approach would be extremely
  847. simple.  In this example, I'll use the fairly standard Alt-X
  848. keypress as a command to exit the program.
  849.           
  850.           Var
  851.             Stop  : Boolean;
  852.             Flags : TTermMode;
  853.           
  854.           begin
  855.             Stop := False;
  856.             while (not Stop) do
  857.              begin
  858.                case TerminalMode(Flags) of
  859.                  #45 : Stop := True;  { alt-X }
  860.                  #73 : Upload;        { PgUp }
  861.                  #81 : Download;      { PgDn }
  862.                end;
  863.              end;
  864.           end;
  865.           
  866.      This is a simple example, but it gets the idea across.  We
  867. want to catch every keypress and process it if we can.  Any keys
  868. not defined in our case statement will just be ignored.  They
  869. will not get sent to the serial port.  Flags is just a record
  870. while tells TerminalMode how to behave.
  871.  
  872. Overriding TerminalMode
  873.  
  874.      The only problem with TerminalMode is that it is a basic
  875. function and probably will not satisfy your needs when you start
  876. implementing a truly robust terminal program.  The solution is,
  877. as always, to override it.  TerminalMode is not a virtual
  878. function because there isn't much you can inherit from it.  If
  879. you override it I cannot see you ever needing to call the parent
  880. method.  (If you end up needing this for some reason, please tell
  881. me and I'll change it immediately.  Until then, you can always
  882. change the source.  Just make sure you don't distribute it!)
  883.      To remain compatible you should probably allow your new
  884. TerminalMode function to return the extended keypress and let an
  885. outside case statement handle the commands.  After all,
  886. TerminalMode is only supposed to handle a terminal session, not
  887. outside events.
  888.  
  889. Tricks and traps
  890.  
  891.      There are far fewer traps for your code to fall into since
  892. there will always be a user at the console, ready to handle any
  893. events your code isn't designed to handle.  For instance, your
  894. terminal never needs to check for an inactivity timeout or
  895. carrier loss.  It just reports the status of the serial line and
  896. sends out characters you tell it to.  Obviously, you will still
  897. need to debug your program and keep it from hanging and the most
  898. inopportune of times, but this is standard practice for any
  899. program being prepared for public distribution.
  900.      Above all, make sure your special features work.  These are
  901. what sets your program aside, letting everyone know that it's the
  902. best.  However, if the very features which make your program
  903. better make it crash, then your program will earn a bad
  904. reputation.  If you add special terminal effects, make sure they
  905. work.
  906.      Good luck!
  907.                                  Chapter 6: BBSkit Unit Reference
  908.                                                                  
  909.      This chapter provides a reference for all of the procedures,
  910. functions and types that are contained in the BBSkit unit.  If
  911. something is new to version 3.0, [New] will be set at the far
  912. right of the item title.  Items which have changed since version
  913. 2.0 of the toolkit are flagged with [Changed] at the right.
  914.  
  915.  
  916. AddIntChar
  917. Declaration:   PROCEDURE AddIntChar(Ch: Char);
  918.  
  919.      Adds an interrupt key to the internal list.  This internal
  920. list is kept for calls to the method TypeFile, which will exit
  921. immediately if one of these keys is received during the display
  922. of a file.  If the case sensitivity flag is set during a
  923. TypeFile, then the case of keys added with AddIntChar will make a
  924. difference.  'A' will not be tripped when the user presses 'a'.
  925. Otherwise, case is ignored.
  926.      This capability is especially useful for aborting files
  927. which display a menu of options to the user.  When the user
  928. presses a key corresponding to an option, displaying the rest of
  929. the menu can become tedious and time consuming.  Using AddIntChar
  930. will allow the menu to be halted as soon as the user presses an
  931. option key.
  932.  
  933. See Also: ClearIntChars, SetCaseSensitivity.
  934.  
  935.  
  936. AddVirtualKey
  937. Declaration:   PROCEDURE AddVirtualKey(Code: Char);
  938.  
  939.      Adds an extended keycode to the internal table of those that
  940. can interrupt a ComReadKey operation.  This will allow the local
  941. operator to do things behind the remote users's back, such as
  942. adjusting the time remaining, setting security levels, or
  943. initiating a chat with the user.
  944.      Use of these keys requires turning virtual keys on through a
  945. call to SetVirtualKeys.  Initially this feature is disabled.  A
  946. list of the extended keycodes can be found in the back of this
  947. manual in Appendix C.
  948.  
  949. See Also: ClearVirtualKeys, SetVirtualKeys.
  950.  
  951.  
  952. ClearIntChars
  953. Declaration:   PROCEDURE ClearIntChars;
  954.  
  955.      Clears the internal list of interrupt characters so that
  956. nothing will interrupt the display of a TypeFile command.
  957.  
  958. See Also: AddIntChar.
  959.  
  960.  
  961. ClearVirtualKeys
  962. Declaration:   PROCEDURE ClearVirtualKeys;
  963.  
  964.      Clears the internal list of extended keycodes which can
  965. perform a function on the local terminal without interrupting the
  966. user of the system.  These keys can be pressed to perform various
  967. functions during any BBSkit routine which makes use of
  968. ComReadKey.  This includes ComReadKeyE and all of the
  969. ComReadLnXXX methods.
  970.  
  971. See Also: AddVirtualKey.
  972.  
  973.  
  974. ClosePort
  975. Declaration:   PROCEDURE ClosePort(LowerDTR: Boolean);
  976.                virtual;
  977.  
  978.      Closes down the comport associated with the object.  The
  979. port must first be initialized with OpenPort before this method
  980. will have any effect on the system.  The LowerDTR parameter tells
  981. BBSkit whether or not to lower the DTR line before closing the
  982. port down.  On most modems, lowering the DTR line will hang up
  983. the phone.
  984.      Override this method to provide any additional functionality
  985. you wish before the port is actually closed down.
  986.  
  987. See Also: OpenPort.
  988.  
  989.  
  990. Cls
  991. Declaration:   PROCEDURE Cls; virtual;
  992.  
  993.      Clears the local screen and attempts to do the same on the
  994. remote screen by sending a ^L character over the modem.  Most
  995. terminals which do not make use of terminal emulation will
  996. interpret a ^L as a screen clear character.  If you are using
  997. emulation, it is a better idea to go ahead and use the EmuClrScr
  998. function to return the correct screen for the remote terminal.
  999.  
  1000. See Also: EmuClrScr (VC unit).
  1001.  
  1002.  
  1003. ComReadKey
  1004. Declaration:   FUNCTION ComReadKey: Char; virtual;
  1005.  
  1006.      Reads a key from any of the legal input sources while at the
  1007. same time switching among the running tasks with MTASK, checking
  1008. for active virtual keys, keeping tabs on the active time limit
  1009. (if any) and making sure the user is not inactive for
  1010. unreasonable amounts of time.  This is the basic input function
  1011. for all of the BBSkit input routines, including the line input
  1012. methods.  This method does not echo the key before returning it.
  1013. If you need this functionality, use ComReadKeyE.
  1014.      It will return the character pressed by the user if any, or
  1015. #0 if an error condition exists.  On return of the null
  1016. character, you should check the time limit, the UserInactive
  1017. method to see what caused the unexpected dropout.
  1018.  
  1019. See Also: ComReadKeyE, ComReadLnXXX, UserInactive.
  1020.  
  1021.  
  1022. ComReadKeyE
  1023. Declaration:   FUNCTION ComReadKeyE: Char; virtual;
  1024.  
  1025.      Calls ComReadKey to get a character, sends the echo
  1026. character to the legal output devices, and returns the character
  1027. to the caller.  This method will provide all of the error
  1028. checking that ComReadKey does, of course, but you still need to
  1029. determine the cause of an error on return of the null character
  1030. (#0).
  1031.  
  1032. See Also: ComReadKey, SetEcho.
  1033.  
  1034.  
  1035. ComReadLn
  1036. Declaration:   PROCEDURE ComReadLn(var Inp: String; Max:
  1037.                Byte); virtual;
  1038.  
  1039.      Reads a line of input into the variable parameter Inp by
  1040. repeatedly calling ComReadKey.  The line cannot exceed Max bytes.
  1041. Once this limit is reached during the read, BBSkit will simply
  1042. wait for either a backspace to make room for more characters, or
  1043. a carriage return to terminate the input line.
  1044.      The following special characters are recognized during the
  1045. input:
  1046.  
  1047.           #8   ^H   Backspace one character (destructive)
  1048.           #9   ^I   Tab over to the next tab stop (every 8
  1049.                     characters)
  1050.           #13  ^M   End the input line
  1051.           #24  ^X   Erase to beginning of line
  1052.  
  1053.      ComReadLn is actually just a call to ComReadLnDefault with a
  1054. null default string.
  1055.  
  1056. See Also: ComReadLnDefault, ComReadLnWrap.
  1057.  
  1058.  
  1059. ComReadLnDefault                                       [New]
  1060. Declaration:   PROCEDURE ComReadLnDefault(var Inp: String;
  1061.                Max: Byte; Default: String); virtual;
  1062.  
  1063.      Reads a line of input in, but allows the program to specify
  1064. a default string of text the user may accept or backspace over to
  1065. type something else.
  1066.      Recognizes the same special keys that the ComReadLn method
  1067. does.
  1068.  
  1069. See Also: ComReadLn, ComReadLnWrap.
  1070.  
  1071.  
  1072. ComReadLnWrap
  1073. Declaration:   PROCEDURE ComReadLnWrap(var Inp: String; Max:
  1074.                Byte; var Wrap: String); virtual;
  1075.  
  1076.      Reads a line of input in with the exception that when the
  1077. maximum number of bytes in the line is reached, it will search
  1078. back to find the beginning of the current word, place it in the
  1079. Wrap variable, and strip it from the line of text returned in
  1080. Inp.  This essentially means that repeatedly calling this method
  1081. will provide the basic wordwrap functionality found in just about
  1082. any editor these days.
  1083.      Call it the first time with Wrap set to a null string or
  1084. whatever junk is there will be placed at the front of the new
  1085. input line.  Also recognizes the same special keys that ComReadLn
  1086. does.
  1087.  
  1088. See Also: ComReadLn, ComReadLnDefault.
  1089.  
  1090.  
  1091. ComWrite
  1092. Declaration:   PROCEDURE ComWrite(Strn: String); virtual;
  1093.  
  1094.      ComWrite will send a line of text out of the output devices
  1095. you have enabled using SetOutput.  This method pays close
  1096. attention to the terminal characteristics you have defined for
  1097. it, including active emulation templates, line feed handling
  1098. after carriage return, nulls for slow terminals and paging
  1099. settings if active.
  1100.      Note that ComWrite does not tack on a carriage return at the
  1101. end of the line.  If you need this type of behavior, use
  1102. ComWriteLn.
  1103.  
  1104. See Also: ComWriteLn, SetOutput.
  1105.  
  1106.  
  1107. ComWriteLn
  1108. Declaration:   PROCEDURE ComWriteLn(Strn: String); virtual;
  1109.  
  1110.      ComWriteLn performs the same function as the ComWrite method
  1111. does, with the exception that it tacks a carriage return on to
  1112. the end of the string.  If line feeds are enabled, a line feed
  1113. will also be sent to the terminal after the carriage return.
  1114.  
  1115. See Also: ComWrite.
  1116.  
  1117.  
  1118. DetectANSI                                             [New]
  1119. Declaration:   FUNCTION DetectANSI: Boolean;
  1120.  
  1121.      This function sends a code defined by the ANSI terminal
  1122. emulation set to the remote terminal.  On receipt of this code,
  1123. ANSI terminals are to respond with the coordinates of the cursor.
  1124. This makes an easy way of determining if the remote terminal has
  1125. ANSI capability without prompting the user.  The function will
  1126. return True if it finds ANSI at the end of the connection, or
  1127. False if nothing shows up within a couple of seconds (more than
  1128. reasonable time).
  1129.  
  1130. See Also: EmuXXX (VC unit).
  1131.  
  1132.  
  1133. Dial
  1134. Declaration:   PROCEDURE Dial(Number: String); virtual;
  1135.  
  1136.      Dial will simply send a Hayes command string to your modem
  1137. which will cause it to dial the number you have passed to the
  1138. procedure.  This number is actually just the tail end of an ATD
  1139. command, so you can modify it to suit your particular needs.  For
  1140. example, to force tone dialing place a T in front of the actual
  1141. number.
  1142.      Note this method is virtual.  If you do not have a Hayes
  1143. compatible modem, or you modem requires special setup before you
  1144. can dial, you can override the procedure to make it do what your
  1145. hardware requires.
  1146.  
  1147. See Also: PickupPhone, SetAnswerMode.
  1148.  
  1149.  
  1150. Done
  1151. Declaration:   DESTRUCTOR Done; virtual;
  1152.  
  1153.      Gracefully takes the object down, frees up resources that
  1154. were being used, and calls the parent Done method to ensure
  1155. everything is cleaned up in parent objects as well.  Any object
  1156. that makes use of TBBS should call Done during their own Done
  1157. method to keep everything as clean as possible at runtime.
  1158.  
  1159. See Also: Init, Run.
  1160.  
  1161.  
  1162. FilterWrite                                        [Changed]
  1163. Declaration:   PROCEDURE FilterWrite(Strn: String); virtual;
  1164.  
  1165. the
  1166. the output to the right console.
  1167.      Additionally, there is support in there now for BBSkit
  1168. Session Protocol.  Please remember that this protocol is being
  1169. phased out of BBSkit and it is strongly recommended that you do
  1170. not make it an integral part of your application.
  1171.  
  1172. See Also: FilterWrite (VC unit).
  1173.  
  1174.  
  1175. FlushSendBuffer                                        [New]
  1176. Declaration:   PROCEDURE FlushSendBuffer;
  1177.  
  1178.      A version of the same code from the Comm unit, but this
  1179. procedure is multitasking aware and will keep things happily
  1180. going in the background until it is time to exit.  All it does is
  1181. wait until the send buffer for the comport is empty, and then
  1182. returns.  It will wait forever if need be.
  1183.  
  1184. See Also: FlushSendBuffer (Comm unit).
  1185.  
  1186.  
  1187. GetAnswerMode
  1188. Declaration:   FUNCTION GetAnswerMode: TAnswerMode;
  1189.  
  1190.      Returns the current answer mode for the object.  The answer
  1191. mode is used by the PickupPhone method to determine what it
  1192. should send to the modem to cause it go off-hook.  For Hayes
  1193. compatible modems, the Originate string is ATD, while the Answer
  1194. string is ATA.
  1195.  
  1196. See Also: PickupPhone, SetAnswerMode.
  1197.  
  1198.  
  1199. GetInput
  1200. Declaration:   PROCEDURE GetInput(var Con, Rem: Boolean);
  1201.  
  1202.      Returns the current settings of the input flags.  These
  1203. flags control who can send input to the input methods of BBSkit.
  1204. If Con is True, the console is allowed to enter stuff at the
  1205. keyboard, and if Rem is True remote input is accepted from the
  1206. comport.  These options are set through SetInput.
  1207.  
  1208. See Also: ComReadXXX, SetInput.
  1209.  
  1210.  
  1211. GetOutput
  1212. Declaration:   PROCEDURE GetOutput(var Con, Rem: Boolean);
  1213.  
  1214.      Returns the status of the output flags for the object.
  1215. These flags control who is sent the output directed through the
  1216. ComWriteXXX methods.  When a flag is True, output is sent to that
  1217. device.  If False, output is masked.
  1218.  
  1219. See Also: ComWriteXXX, SetOutput.
  1220.  
  1221.  
  1222. HandleVirtualKey
  1223. Declaration:   FUNCTION HandleVirtualKey(Code: Char):
  1224.                Boolean; virtual;
  1225.  
  1226.      Use of this method is rather tricky.  It is used by the
  1227. ComReadKey method when an extended key on the local console is
  1228. pressed (such as the arrow keys, or a function key).  When
  1229. called, it sends the extended keycode of the key pressed to
  1230. HandleVirtualKey, which must then interpret how to handle it.  It
  1231. may just alter flags, or it may enter into a chat mode.
  1232.      It must be overridden by your code.  Otherwise it does
  1233. nothing.  The return value is designed to tell ComReadKey if it
  1234. should bother continuing to get input.  For the majority of
  1235. things, this will be False, telling ComReadKey that no it should
  1236. not quit getting input.  But for certain cases (for example, a
  1237. command to log the user out immediately) there is no reason to
  1238. continue input, so HandleVirtualKey should return False.  This is
  1239. a tricky subject, so checking out the example Host.Pas program
  1240. may help to clear the smoke.
  1241.  
  1242. See Also: AddVirtualKey, SetVirtualKeys.
  1243.  
  1244.  
  1245. Hangup
  1246. Declaration:   FUNCTION Hangup: Boolean; virtual;
  1247.  
  1248.      This method attempts to put the modem on-hook, essentially
  1249. hanging up the phone.  It does so by first making an on-off-on
  1250. transition of the DTR line, which on most modems causes them to
  1251. hang up and return to the command state.  If this fails, it will
  1252. try to send the +++ attention sequence, followed by the Hayes
  1253. standard ATH0 hangup command.
  1254.      The return value of this method signals you if it was able
  1255. to hang up the modem.  If there is a carrier at the end of the
  1256. method, it returns False, letting you know that the line is not
  1257. clear.  Otherwise, if everything works out okay, the line is
  1258. clear and it will return True.
  1259.      If your modem will not hangup using any of these approaches,
  1260. you may want to override the method and use a command known to
  1261. work for your modem.  Be aware that a modem which always reports
  1262. a carrier will never appear to be successful using this method
  1263. (the return value will always be False).  You can also try
  1264. sending ATX3 to your modem before trying to hangup.  This will
  1265. tell most modems to recognize the DTR transition (the most
  1266. reliable way of hanging up).
  1267.  
  1268. See Also: PickupPhone.
  1269.  
  1270.  
  1271. Incoming
  1272. Declaration:   FUNCTION Incoming: Boolean;
  1273.  
  1274.      Returns the status of input waiting at any of the legal
  1275. input devices.  Basically, this returns true if anything can be
  1276. gotten using a ComReadKey.
  1277.  
  1278. See Also: Keypressed (CRT unit), ReceiveBufferEmpty (Comm unit).
  1279.  
  1280.  
  1281. Init
  1282. Declaration:   CONSTRUCTOR Init;
  1283.  
  1284.      Initializes the TBBS object by calling the parent Init
  1285. method, and setting up the values for some internal variables.
  1286. Any objects that make use of TBBS should be sure to call Init as
  1287. the first action in their own init code, to ensure proper binding
  1288. at runtime.
  1289.  
  1290. See Also: Done, Run.
  1291.  
  1292.  
  1293. OpenPort                                           [Changed]
  1294. Declaration:   FUNCTION OpenPort(Comport: Byte): Boolean;
  1295.  
  1296.      OpenPort has been changed slightly for version 3.0 to
  1297. interface with the multiport support built into the Comm unit.
  1298. The first parameter is actually an index into the array kept by
  1299. the Comm unit.  The first four values of the array correspond to
  1300. the standard COM1 through COM4 familiar to IBM PCs.  The fifth
  1301. through eighth entries are left for user expansion, perhaps for a
  1302. multiport card.
  1303.      OpenPort also now uses the value of TBBS_BufferSize to
  1304. initialize the buffer size for new ports.  This value is a typed
  1305. constant and can be changed at runtime before a port is opened.
  1306. Changing the value after the port is opened does not affect the
  1307. buffer size.  Keep in mind only one port per object can be
  1308. opened.  If you need more, you can either continuously close and
  1309. open ports, or you can use multiple objects.
  1310.  
  1311. See Also: ClosePort, TBBS_BufferSize constant.
  1312.  
  1313.  
  1314. PBBS type
  1315. Declaration:   PBBS = ^TBBS;
  1316.  
  1317.      PBBS is simply a pointer to the TBBS object type.
  1318.  
  1319. See Also: TBBS type.
  1320.  
  1321.  
  1322. PickupPhone
  1323. Declaration:   PROCEDURE PickupPhone; virtual;
  1324.  
  1325.      PickupPhone is designed to send a command to your modem
  1326. instructing it to place the modem off-hook and send the
  1327. appropriate tones over the phone line.  Hayes compatible modems
  1328. will already be compatible with the version of PickupPhone
  1329. provided with BBSkit.  However, you may wish to override the
  1330. method with your own code if your modem requires different
  1331. commands.
  1332.      PickupPhone will send ATD to the modem when it is in
  1333. Originate modem, otherwise it will send ATA (when in Answer
  1334. mode).
  1335.  
  1336. See Also: Dial, SetAnswerMode.
  1337.  
  1338.  
  1339. ReceiveXmodem                                          [New]
  1340. Declaration:   FUNCTION ReceiveXmodem(Mode: Byte; Fname:
  1341.                PathStr): TError; virtual;
  1342.  
  1343.      This method performs the exact same function as the
  1344. ReceiveXmodem in the Protocol unit, with the exception that any
  1345. running time limits are suspended before the upload and resumed
  1346. after the upload is complete.  This makes it encouraging for
  1347. users to upload to your system, as it will not detract from the
  1348. time remaining in their session.
  1349.  
  1350. See Also: ReceiveXmodem (Protocol unit).
  1351.  
  1352.  
  1353. ReceiveYmodem                                          [New]
  1354. Declaration:   FUNCTION ReceiveYmodem(Mode: Byte; ToPath:
  1355.                PathStr): TError; virtual;
  1356.  
  1357.      This method performs the exact same function as the
  1358. ReceiveYmodem in the Protocol unit, with the exception that any
  1359. running time limits are suspended before the upload and resumed
  1360. after the upload is complete.  This makes it encouraging for
  1361. users to upload to your system, as it will not detract from the
  1362. time remaining in their session.
  1363.  
  1364. See Also: ReceiveYmodem (Protocol unit).
  1365.  
  1366.  
  1367. Run
  1368. Declaration:   PROCEDURE Run; virtual;
  1369.  
  1370.      Actually an empty method in the TBBS code, this procedure is
  1371. intended to be overridden by your object, which will in turn do
  1372. the actual work of your object.
  1373.  
  1374. See Also: Done, Init.
  1375.  
  1376.  
  1377. SendAT
  1378. Declaration:   FUNCTION SendAT(Cmd: String): Boolean;
  1379.  
  1380.      This method sends an AT command to your modem and waits for
  1381. the expected "OK" response for up to two seconds.  This should be
  1382. ample time for your modem to respond, even during the longest
  1383. commands (ATZ on my modem takes a little under a second).
  1384.      Your command must be fully formed.  That is, it must be the
  1385. full AT command, including the AT prefix, for this method to
  1386. work.  The return value is whether or not it succeeded.  It will
  1387. return True if it saw the correct OK response within two seconds,
  1388. False otherwise.
  1389.  
  1390.  
  1391. SendChar                                               [New]
  1392. Declaration:   PROCEDURE SendChar(Ch: Char);
  1393.  
  1394.      This is the generic routine which will send characters out
  1395. the serial port which has been opened by the current object.  It
  1396. checks for handshaking, user inactivity, and full buffers before
  1397. sending anything out.  Additionally it will happily keep things
  1398. going in the background using MTASK.
  1399.      This method is called by all the output routines when
  1400. something needs to be sent out through the serial port.
  1401.  
  1402. See Also: SendW (Comm unit).
  1403.  
  1404.  
  1405. SetAnswerMode
  1406. Declaration:   PROCEDURE SetAnswerMode(Status: TAnswerMode);
  1407.  
  1408.      Sets the answer mode to either Originate or Answer.  This is
  1409. purely for letting PickupPhone know which tone to send across the
  1410. phone line after it goes off-hook.  The default is Originate.
  1411.  
  1412. See Also: PickupPhone.
  1413.  
  1414.  
  1415. SetCaptureFile
  1416. Declaration:   PROCEDURE SetCaptureFile(Path: ComStr);
  1417.  
  1418.      Sets the capture file for I/O capturing.  Capture is not
  1419. actually turned on until you call SetCaptureStatus and turn it on
  1420. with a True argument.  The only I/O which is captured and sent to
  1421. the file is that which is sent out through the standard BBSkit
  1422. ComWriteXXX routines.  The default file is CAPTURE.TXT.
  1423.  
  1424. See Also: SetCaptureStatus, SetPrinter.
  1425.  
  1426.  
  1427. SetCaptureStatus
  1428. Declaration:   PROCEDURE SetCaptureStatus(Status: Boolean);
  1429.  
  1430.      Either turns capturing on or turns capturing off.  Captured
  1431. text goes to the file which was previously set using
  1432. SetCaptureFile, or CAPTURE.TXT if unset.  Existing files are not
  1433. overwritten, they are appended.  Once turned on, all output sent
  1434. to ComWriteXXX will also be redirected to the capture file.
  1435.  
  1436. See Also: SetCaptureFile, SetPrinter.
  1437.  
  1438.  
  1439. SetCaseSensitivity
  1440. Declaration:   PROCEDURE SetCaseSensitivity(Status:
  1441.                Boolean);
  1442.  
  1443.      Toggles the case sensitivity of the WaitFor routine.  When
  1444. called with a True argument, WaitFor is case sensitive.  "OK"
  1445. will not match when WaitFor is called with an "ok" argument.
  1446. When case sensitivity is turned off, "OK" is equal to "ok".
  1447.  
  1448. See Also: WaitFor.
  1449.  
  1450.  
  1451. SetEcho
  1452. Declaration:   PROCEDURE SetEcho(Ch: Char);
  1453.  
  1454.      Sets which character is echoed to the remote user when a key
  1455. is fetched using ComReadKeyE.  By default, the key echoed is the
  1456. key pressed.  However, there are times when the keys pressed
  1457. should not be echoed back for security reasons (for example,
  1458. during password entry or modification).  In this case, you can
  1459. pass a non-null character to SetEcho and that character will be
  1460. echoed back after each pressed key.  You can turn echoing off
  1461. again by passing SetEcho the null character (#0).
  1462.  
  1463. See Also: ComReadKeyE.
  1464.  
  1465.  
  1466. SetInput
  1467. Declaration:   PROCEDURE SetInput(Con, Rem: Boolean);
  1468.  
  1469.      SetInput controls the devices BBSkit is legally allowed to
  1470. get input from.  The first argument controls whether or not input
  1471. from the local keyboard is permitted, while the second argument
  1472. controls whether or not input is permitted from the serial port.
  1473. The input masking is only performed when ComReadKey or one of the
  1474. method which use it is called.  It does not affect direct calls
  1475. to ReadKey (from the CRT unit) or ReceiveW (from the Comm unit).
  1476.  
  1477. See Also: SetOutput.
  1478.  
  1479.  
  1480. SetInputCap
  1481. Declaration:   PROCEDURE SetInputCap(Style: TCapStyle);
  1482.  
  1483.      Controls the way that ComReadLn and the associated line
  1484. input methods capitalize input.  There are four different
  1485. settings:
  1486.  
  1487.           NoCaps    No changes made to typed text
  1488.           Upper     Converts everything to uppercase
  1489.           Lower     Converts everything to lowercase
  1490.           Proper    Converts the first letter of each word
  1491.                     to upper, everything else lower
  1492.  
  1493.      Once the cap style is set, it will remain in the same mode
  1494. until set again with another style.
  1495.  
  1496. See Also: ComReadLnxxx methods.
  1497.  
  1498.  
  1499. SetLF
  1500. Declaration:   PROCEDURE SetLF(Status: Boolean);
  1501.  
  1502.      Controls whether or not line feeds will be sent after a
  1503. carriage return.  Most modern terminals require a linefeed in
  1504. order to not overwrite the previous line.
  1505.  
  1506. See Also: SetNulls.
  1507.  
  1508.  
  1509. SetNulls
  1510. Declaration:   PROCEDURE SetNulls(Num : Byte);
  1511.  
  1512.      Controls how many null (padding) characters are sent after a
  1513. carriage return character.  Some old terminals are slow at
  1514. updating video, and without an input buffer for the serial line,
  1515. they require characters which are expendable to give the video
  1516. time to catch up with the serial I/O.  Nulls are used for this
  1517. purpose.  Most of the time this will be set to 0.
  1518.  
  1519. See Also: SetLF.
  1520.  
  1521.  
  1522. SetOutput
  1523. Declaration:   PROCEDURE SetOutput(Con, Rem: Boolean);
  1524.  
  1525.      SetOutput controls the devices that BBSkit is instructed to
  1526. send output to.  The two standard ones are the console and the
  1527. remote user.  If Con is set to true, output will be directed
  1528. towards the console and will appear on the local screen.  If Rem
  1529. is true, output will be sent out the serial port and eventually
  1530. appear on the remote user's screen.
  1531.  
  1532. See Also: SetInput.
  1533.  
  1534.  
  1535. SetPaging
  1536. Declaration:   PROCEDURE SetPaging(Status: Boolean);
  1537.  
  1538.      Sets whether or not BBSkit will attempt to page output.
  1539. When paging is turned on, every time the screen is supposed to be
  1540. full, it will pause for the user to hit a key before continuing.
  1541. The number of lines it will pause can be set through
  1542. SetPagingLines, while the message sent to the user is set through
  1543. SetPagingMsg.
  1544.  
  1545. See Also: SetPagingLines, SetPagingMsg.
  1546.  
  1547.  
  1548. SetPagingLines
  1549. Declaration:   PROCEDURE SetPagingLines(Num: Byte);
  1550.  
  1551.      Controls the number of lines per screen so that BBSkit's
  1552. paging can operate properly.  When paging is turned on (through
  1553. SetPaging), every time the line counter reaches just below the
  1554. screen length, it will pause and wait for user input before
  1555. continuing.
  1556.  
  1557. See Also: SetPaging, SetPagingMsg.
  1558.  
  1559.  
  1560. SetPagingMsg
  1561. Declaration:   PROCEDURE SetPagingMsg(Msg: String);
  1562.  
  1563.      Sets the message displayed to the user when a page fills up.
  1564. This message should only be a single line, and preferably less
  1565. than 10 or so characters long.  It will be displayed when a user
  1566. reaches the end of a page and should prompt the user to press a
  1567. key before continuing output.
  1568.  
  1569. See Also: SetPaging, SetPagingLines.
  1570.  
  1571.  
  1572. SetPrinter
  1573. Declaration:   PROCEDURE SetPrinter(Status: Boolean);
  1574.  
  1575.      Sets the printer status for output.  When True, any output
  1576. sent out through the standard BBSkit output functions will also
  1577. be directed towards the standard printer, LPT1:.  This is the
  1578. same printer that Turbo Pascal uses in the Printer unit, so if
  1579. your printer works in other Pascal programs, it will work with
  1580. BBSkit.
  1581.  
  1582. See Also: ComWrite, ComWriteLn, SetCaptureFile, SetCaptureStatus.
  1583.  
  1584.  
  1585. SetTimeLimit
  1586. Declaration:   PROCEDURE SetTimeLimit(Min: Word);
  1587.  
  1588.      Sets the time limit for the user in minutes.  As soon as
  1589. this method is called, the time limit is set and the countdown
  1590. will begin immediately.  To stop the timer you have to call
  1591. SetTimeLimitStatus with a false argument.  To restart the timer,
  1592. call SetTimeLimitStatus with a true argument.
  1593.  
  1594. See Also: SetTimeLimitStatus.
  1595.  
  1596.  
  1597. SetTimeLimitStatus                                     [New]
  1598. Declaration:   PROCEDURE SetTimeLimitStatus(Status:
  1599.                Boolean);
  1600.  
  1601.      Enables or disables the user time limit based on the Status
  1602. argument.  If the argument is True, the countdown timer is
  1603. started, if False, it is stopped.
  1604.  
  1605. See Also: SetTimeLimit.
  1606.  
  1607.  
  1608. SetTimer
  1609. Declaration:   PROCEDURE SetTimer(Status: Boolean);
  1610.  
  1611.      Controls the inactivity timer contained in BBSkit.  When
  1612. True, the inactivity timer will watch for activity from the user
  1613. during input routines, and if the timeout period goes by without
  1614. a keypress, a warning message will be displayed and the user
  1615. given a last chance to do something or be logged out.  If False,
  1616. no inactivity checking is performed.
  1617.  
  1618. See Also: SetTimerDelay, SetTimerMsg.
  1619.  
  1620.  
  1621. SetTimerDelay
  1622. Declaration:   PROCEDURE SetTimerDelay(Dly: Word);
  1623.  
  1624.      Sets the number of seconds that the user can be inactive
  1625. before a warning is issued signaling a pending logout.  The user
  1626. is given 15 additional seconds after the warning is given, and if
  1627. no activity shows up, the user is logged out.
  1628.  
  1629. See Also: SetTimer, SetTimerMsg.
  1630.  
  1631.  
  1632. SetTimerMsg
  1633. Declaration:   PROCEDURE SetTimerMsg(Msg: String);
  1634.  
  1635.      Sets the message which is sent to the user when an
  1636. inactivity timeout occurs.  This message should let the user know
  1637. that a logout is pending and that they have a short period of
  1638. time to do something before being logged out.  The default
  1639. message is "Hello?" followed by a bell (#7) character.
  1640.  
  1641. See Also: SetTimer, SetTimerDelay.
  1642.  
  1643.  
  1644. SetVirtualKeys
  1645. Declaration:   PROCEDURE SetVirtualKeys(Status: Boolean);
  1646.  
  1647.      Sets whether or not virtual keys are handled by the BBSkit
  1648. input routines.  Virtual keys are by default turned off, so if
  1649. you add them to your application you must enable them with a call
  1650. to this method.
  1651.  
  1652. See Also: AddVirtualKey, ClearVirtualKeys, HandleVirtualKey.
  1653.  
  1654.  
  1655. TAnswerMode type
  1656. Declaration:   TAnswerMode = (Answer, Originate);
  1657.  
  1658.      Used by the GetAnswerMode and SetAnswerMode methods for
  1659. getting and setting the answer mode, respectively.  The answer
  1660. mode is used by BBSkit when PickupPhone is called and decides
  1661. what will be sent to the modem to pickup the phone.  Usually this
  1662. will be ATA for answer mode, and ATD for originate mode.
  1663.  
  1664. See Also: GetAnswerMode, PickupPhone, SetAnswerMode.
  1665.  
  1666.  
  1667. TBBS object                                        [Changed]
  1668. Declaration:   TBBS = object
  1669.  
  1670.      This declaration of the TBBS type is very abbreviated
  1671. because of the many methods which are contained in the object
  1672. itself.  Here is a list of all of the methods available in a TBBS
  1673. object, and where they originated.  Virtual methods are
  1674. identified by italics.  The method originates in the TBBS object
  1675. unless otherwise stated.
  1676.  
  1677. AddBatch [Protocol]           AddIntChar
  1678. AddVirtualKey                 AverageCps [Protocol]
  1679. BatchFile [Protocol]          CarrierLost [Protocol]
  1680. ClearBatch [Protocol]         ClearIntChars
  1681. ClearVirtualKeys              ClosePort
  1682. CloseWindow [VC]              ClrEOL [VC]
  1683. ClrScr [VC]                   Cls
  1684. ComReadKey                    ComReadKeyE
  1685. ComReadLn                     ComReadLnDefault
  1686. ComReadLnWrap                 ComWrite
  1687. ComWriteLn                    Delay [VC]
  1688. DeleteFromBatch [Protocol]    DelLine [VC]
  1689. DetectANSI                    Dial
  1690. Done                          EmuClrEOL [VC]
  1691. EmuClrEOS [VC]                EmuClrScr [VC]
  1692. EmuClrTop [VC]                EmuColor [VC]
  1693. EmuCursorDown [VC]            EmuCursorLeft [VC]
  1694. EmuCursorRight [VC]           EmuCursorUp [VC]
  1695. EmuDelChar [VC]               EmuDelLine [VC]
  1696. EmuGotoXY [VC]                EmuInsChar [VC]
  1697. EmuInsLine [VC]               EmuNormal [VC]
  1698. EmuReverse [VC]               EmuScrollDown [VC]
  1699. EmuScrollUp [VC]              FilesInBatch [Protocol]
  1700. FilterWrite                   FilterWriteLn [VC]
  1701. FlushSendBuffer               GetAnswerMode
  1702. GetInput                      GetOutput
  1703. GetScreenWord [VC]            GetText [VC]
  1704. GetTextBackground [VC]        GetTextColor [VC]
  1705. GotoXY [VC]                   HandleVirtualKey
  1706. Hangup                        HideTextCursor [VC]
  1707. HighVideo [VC]                Incoming
  1708. Init                          InsLine [VC]
  1709. IntegerVal                    Keypressed [VC]
  1710. LoadEmulation [VC]            LoadEmulationLib [VC]
  1711. LowVideo [VC]                 NormVideo [VC]
  1712. OpenPort                      OpenWindow [VC]
  1713. PickupPhone                   PutScreenWord [VC]
  1714. PutText [VC]                  ReadKey [VC]
  1715. ReceiveXmodem                 ReceiveYmodem
  1716. Run                           SendAT
  1717. SendChar                      SendInteger
  1718. SendXmodem [Protocol]         SendYmodem [Protocol]
  1719. SetAnswerMode                 SetBSP
  1720. SetCaptureFile                SetCaptureStatus
  1721. SetCaseSensitivity            SetEcho
  1722. SetInput                      SetInputCap
  1723. SetLF                         SetNulls
  1724. SetOutput                     SetPaging
  1725. SetPagingLines                SetPagingMsg
  1726. SetPrinter                    SetTimeLimit
  1727. SetTimeLimitStatus            SetTimer
  1728. SetTimerDelay                 SetTimerMsg
  1729. SetVirtualKeys                SetWindowTitle [VC]
  1730. ShowTextCursor [VC]           TerminalMode
  1731. TextBackground [VC]           TextColor [VC]
  1732. TextMode [VC]                 TranslateString [VC]
  1733. TypeFile                      TypeFileParseLine
  1734. TypeRestOfFile                UserInactive
  1735. ValidString [VC]              vcReadLn [VC]
  1736. vcWrite [VC]                  vcWriteLn [VC]
  1737. WaitFor                       WhereX [VC]
  1738. WhereY [VC]                   Window [VC]
  1739. WindowHeight [VC]             WindowWidth [VC]
  1740.  
  1741.      There are also several variables declared in the private
  1742. section of the object.  These variables are internal to the
  1743. working of the TBBS object and do not affect the use of variables
  1744. in your own code.
  1745.  
  1746. See Also: TBBS methods.
  1747.  
  1748.  
  1749. TBBS_BufferSize constant                               [New]
  1750. Declaration:   TBBS_BufferSize: Word = 5120;
  1751.  
  1752.      This value is used by the OpenPort method to set the size of
  1753. the input and output buffers while using the internal
  1754. communications routines.  The default is 5k, but you may change
  1755. it to any value prior to initializing the port.  Once
  1756. initialized, however, the value is fixed.
  1757.  
  1758. See Also: OpenPort.
  1759.  
  1760.  
  1761. TCapStyle type
  1762. Declaration:   TCapStyle = (NoCaps, UpperCase, LowerCase,
  1763.                Proper);
  1764.  
  1765.      Used by the SetInputCap method and the ComReadLn routines to
  1766. define how inputted text will be formatted.
  1767.      NoCaps will let all input through untouched.  UpperCase and
  1768. LowerCase convert all keystrokes to upper or lower case,
  1769. respectively.  Proper will capitalize the first letter of each
  1770. word, and lowercase the rest of the string.
  1771.  
  1772. See Also: ComReadLn methods, SetInputCap.
  1773.  
  1774.  
  1775. TDuplex type
  1776. Declaration:   TDuplex = (Full, Half, Chat);
  1777.  
  1778.      Used in the TTermMode record to define how the TerminalMode
  1779. method will echo characters back to the local console.  Full
  1780. echoes no characters, while Half and Chat will echo each
  1781. character as it is typed.  Additionally, Chat duplex will issue a
  1782. linefeed after each carriage return.
  1783.  
  1784. See Also: TerminalMode method, TTermMode type.
  1785.  
  1786.  
  1787. TerminalMode                                       [Changed]
  1788. Declaration:   FUNCTION TerminalMode(Flags: TTermMode):
  1789.                Char;
  1790.  
  1791. keypress.
  1792. keypress.  An extended keypress are those that return a leading
  1793. #0 (null) character to the CRT unit ReadKey function.  This
  1794. allows all of the normal keys to be sent through to the remote
  1795. site, without taking up one for an exit key.
  1796.      This type of functionality also allows TerminalMode to be
  1797. expanded without editing the method itself.  You can define
  1798. macros simply by running a case statement on the result of the
  1799. TerminalMode method, and sending strings out on the receipt of
  1800. certain keys.  Other keys can change the bps rate, the duplex,
  1801. backspace handling, uploads/downloads, or exiting the program.
  1802.      TerminalMode can be called repeatedly after each extended
  1803. keypress is handled to keep things moving.
  1804.  
  1805. See Also: TTermMode record.
  1806.  
  1807.  
  1808. TTermMode record                                       [New]
  1809. Declaration:   TTermMode = record
  1810.                  Duplex       : TDuplex;
  1811.                  ShowControls : Boolean;
  1812.                  Backspace    : Char;
  1813.                end;
  1814.  
  1815.      This record structure is used by the TerminalMode method to
  1816. provide some flexible functionality to a terminal session.  It
  1817. allows you to define the duplex of a connection (if and how
  1818. characters are echoed to your local terminal), whether or not
  1819. control characters are displayed as-is or if they are converted
  1820. to inverse uppercase, and lastly what character to send when a
  1821. backspace is typed on the local terminal.
  1822.      For example, some terminals like seeing a #8 character (^H)
  1823. as a backspace, while others prefer to use #127 (RUB, or ^? on
  1824. some machines).
  1825.  
  1826. See Also: TDuplex type, TerminalMode method.
  1827.  
  1828.  
  1829. TypeFile                                           [Changed]
  1830. Declaration:   PROCEDURE TypeFile(Fname: String);
  1831.  
  1832.      Works much like the DOS TYPE command.  Will open a file,
  1833. read a block from it, and send it out the legal output devices.
  1834. With 3.0, functionality has been added for some measure of
  1835. scripting capability inside text files.  Before a line is
  1836. printed, it is sent through TypeFileParseLine, which can pick a
  1837. block of text apart, substituting text strings for token keywords
  1838. TypeFile will also quit on keys contained in the list of
  1839. interrupt keys.
  1840.  
  1841. See Also: TypeFileParseLine, TypeRestOfFile.
  1842.  
  1843.  
  1844. TypeFileParseLine                                      [New]
  1845. Declaration:   FUNCTION TypeFileParseLine(Strn: String):
  1846.                Boolean; virtual;
  1847.  
  1848.      Parses and outputs a text string to the standard output
  1849. devices.  There are several things that this method must do
  1850. before exiting back to the calling code:
  1851.  
  1852.          Parse the text string, substituting text strings for
  1853.           any tokens defined by the application.
  1854.          Output the text string, one character at a time.
  1855.          Check to see if any keypresses exist in the buffer.  If
  1856.           they do, find out if any of them exist as interrupt
  1857.           keys, and if they do, quit with a True return value.
  1858.          Return False if there were no problems.
  1859.  
  1860.      Look through the example code in the BBSKIT.PAS file for
  1861. hints on how to write your own parsing routine.  The stock
  1862. version does no parsing, but parsing is a simple matter of
  1863. checking for existing token strings and replacing them with new
  1864. text.  Tokens should start with some unusual character or be
  1865. bound in some way.  For example, the token for a user's name
  1866. could be %USERNAME or {USERNAME}.
  1867.  
  1868. See Also: TypeFile, TypeRestOfFile.
  1869.  
  1870.  
  1871. TypeRestOfFile                                         [New]
  1872. Declaration:   PROCEDURE TypeRestOfFile(var F: Text);
  1873.  
  1874.      This method takes an already opened text file, and outputs
  1875. the rest of it to the legal output devices.  This is very useful
  1876. for opening a menu, reading the list of interruptable keys, and
  1877. then outputting the rest of the file to the output devices.
  1878.      Please note that since you opened the file, you are expected
  1879. to close it!  Also, there will be problems with text files that
  1880. do not force a carriage return at least every 254 characters.  An
  1881. example of one program which does not produce hard carriage
  1882. returns is TheDraw, which is used for many ANSI screen art files.
  1883.  
  1884. See Also: TypeFile, TypeFileParseLine.
  1885.  
  1886.  
  1887. UserInactive                                           [New]
  1888. Declaration:   FUNCTION UserInactive: Boolean;
  1889.  
  1890.      Returns a boolean variable which lets you know if a user
  1891. inactivity timeout has occurred.  When it returns with a True
  1892. value, you are expected to handle it and log the user off of your
  1893. system.
  1894.  
  1895. See Also: CarrierLost (Protocol unit), SetTimer.
  1896.  
  1897.  
  1898. VersionID                                              [New]
  1899. Declaration:   FUNCTION VersionID: String;
  1900.  
  1901.      Returns a string detailing the version and revision
  1902. information for BBSkit.
  1903.  
  1904. See Also:
  1905.  
  1906.  
  1907. WaitFor
  1908. Declaration:   FUNCTION WaitFor(Strn: String; MaxTime:
  1909.                Word): Boolean;
  1910.  
  1911.      Waits for a specified string for a maximum interval of
  1912. MaxTime seconds.  This method is also set up to wait forever if
  1913. passed an argument of 0 for MaxTime.  Case sensitivity of this
  1914. method is controlled by the value passed to the
  1915. SetCaseSensitivity method.  When True, "OK" will not match "ok".
  1916. When False, they are identical strings as far as WaitFor is
  1917. concerned.
  1918.      Returns True if the string was seen within the allowed time,
  1919. False otherwise.
  1920.  
  1921. See Also: SetCaseSensitivity.
  1922.                                Chapter 7: Protocol Unit Reference
  1923.                                                                  
  1924.  
  1925.  
  1926. BufferSize
  1927. Declaration:   BufferSize = 20480;
  1928.  
  1929.      Defines the size of the buffer used during transfers.  The
  1930. buffer only exists during a transfer and is allocated from the
  1931. heap.  This value must be a multiple of 1024 bytes (which is the
  1932. largest packet used by the engine at this writing).
  1933.  
  1934. See Also:
  1935.  
  1936.  
  1937. CarrierLost
  1938. Declaration:   FUNCTION CarrierLost: Boolean;
  1939.  
  1940.      Checks the COM port ErrorFlg carrier lost bit.  If a carrier
  1941. does not exist when it once did, this function will return True,
  1942. signaling that you need to handle the user logoff procedure.
  1943. This function is defined here but it also available in all
  1944. descendent objects.
  1945.  
  1946. See Also:
  1947.  
  1948.  
  1949. Done
  1950. Declaration:   DESTRUCTOR Done; virtual;
  1951.  
  1952.      Object destructor for the protocol engine.  This method
  1953. should be called when the object is no longer needed in order to
  1954. clean things up.
  1955.      It will call the Done destructor from the parent
  1956. TVirtualConsole object type.
  1957.  
  1958. See Also: Init.
  1959.  
  1960.  
  1961. Init
  1962. Declaration:   CONSTRUCTOR Init;
  1963.  
  1964.      This is the object constructor for the protocol engine.  It
  1965. sets up some internal variables and prepares most of the object
  1966. for use.  You must call this constructor in order to properly set
  1967. up the virtual method table at runtime.
  1968.      This method is inherited and overridden from the
  1969. TVirtualConsole object.
  1970.  
  1971. See Also: Done.
  1972.  
  1973.  
  1974. ReceiveXmodem
  1975. Declaration:   FUNCTION ReceiveXmodem(Mode: Byte; Fname:
  1976.                PathStr): TError; virtual;
  1977.  
  1978.      Receives a single file using the Xmodem protocol to the file
  1979. named in Fname.  The file cannot exist or an error condition will
  1980. result.  Returns the error which caused the transfer to fail, or
  1981. NoError if things went okay.
  1982.      The Mode variable is made up of one or more of the transfer
  1983. constants defined in this unit.  You can combine two or more of
  1984. the constants by ORing them together (i.e. CRC OR Turbo).
  1985.  
  1986. See Also: SendXmodem, TError type, Transfer constants.
  1987.  
  1988.  
  1989. SendXmodem
  1990. Declaration:   FUNCTION SendXmodem(Mode: Byte; Fname:
  1991.                PathStr): TError; virtual;
  1992.  
  1993.      Sends a single file using the Xmodem protocol.  Fname must
  1994. exist and not be a directory.  Returns the error condition which
  1995. caused the transfer to fail, or NoError if the transfer was
  1996. successful.
  1997.      The Mode variable controls which flavor of Xmodem will be
  1998. used.  Note that the Turbo modifier cannot be used during an
  1999. Xmodem send; therefore the only legal values for Mode are
  2000. Checksum, CRC, or OneK.  ORing these together won't affect a
  2001. transfer since they are all mutually exclusive.
  2002.  
  2003. See Also: ReceiveXmodem, TError type, Transfer constants.
  2004.  
  2005.  
  2006. TError type
  2007. Declaration:   TError = (NoError, TimeOut, TooManyErrors,
  2008.                Aborted, DiskError, NoCarrier, FileExists,
  2009.                FileNotFound);
  2010.  
  2011.      This enumerated type defines the various error conditions
  2012. that are returned by the protocol after a transfer has either
  2013. succeeded (NoError) or failed (any of the others).  There is also
  2014. a variable in all batch items that defines the error code.  This
  2015. error code will be NoError for all transfers up to the one that
  2016. failed, which will contain the reason the transfer ultimately
  2017. failed.
  2018.  
  2019. See Also: TBatchItem type.
  2020.  
  2021.  
  2022. Transfer constants
  2023. Declaration:   (in Const block)
  2024.  
  2025. BBSkit.
  2026. BBSkit.
  2027.  
  2028. Turbo = $80    Auto-ACK for receive only; no error checking
  2029.                is performed.
  2030.  
  2031. Xmodem
  2032. Checksum = $00 128 byte packets + 8-bit checksum error
  2033.                detection & correction.
  2034. CRC      = $01 128 byte packets + 16-bit CRC error detection
  2035.                & correction.
  2036. OneK     = $03 1024 byte packets + 16-bit CRC error
  2037.                detection & correction.
  2038.  
  2039. Ymodem
  2040. Normal    = $00     1024 byte packets, 16-bit CRC error
  2041.                     detection & correction, batching.
  2042. Streaming = $01     1024 byte packets, 16-bit CRC error
  2043.                     detection (no correction), batching.
  2044.  
  2045.      These constants can be passed to the protocol methods in
  2046. combination by using the OR operator.
  2047.  
  2048. See Also:
  2049.                                      Chapter 8: VC Unit Reference
  2050.                                                                  
  2051.  
  2052. What is a virtual console?
  2053.  
  2054.      BBSkit 3.0 introduces something borrowed from the Linux
  2055. project, a free UNIX for 386-class machines or better: virtual
  2056. consoles.  A virtual console is a way of allowing more than one
  2057. session to run on a single terminal, or in our case, allow more
  2058. than one video screen/keyboard combination to be accessed on a
  2059. single machine.
  2060.      The most obvious use for such a thing as this is for
  2061. multiple nodes running on a single machine.  Virtual consoles in
  2062. BBSkit take advantage of the MTASK unit to provide task switching
  2063. in the background and to keep things running smoothly.  You can
  2064. switch among the various virtual consoles by using the left Alt
  2065. key in combination with the F1 through F10 keys, for a total of
  2066. ten virtual consoles.
  2067.      Since each virtual console has it's own keyboard buffer and
  2068. it's own video memory, it is necessary to redefine virtually all
  2069. of the procedures found in the CRT unit with ones that will work
  2070. with MTASK and write to the correct virtual console instead of
  2071. the physical video memory provided by your video card.  This way
  2072. you can switch to a console and instantly see where a user is,
  2073. without having to wait for any output to give you a clue about
  2074. what's going on.
  2075.      The methods in the TVirtualConsole object provided in this
  2076. unit operate only on the console that it is attached to.  That
  2077. is, calling HideTextCursor will only hide the text cursor on the
  2078. display if the console which requested it is visible on the local
  2079. screen.  Otherwise it happily takes care of things in the
  2080. background.
  2081.      Remember that you can switch among the consoles using the
  2082. left Alt key in combination with the functions keys F1 through
  2083. F10.  You can add more consoles if you need them and feel like
  2084. hacking the system task (not recommended).
  2085.  
  2086.  
  2087. AllowVCSwitching
  2088. Declaration:   PROCEDURE AllowVCSwitching(Status: Boolean);
  2089.  
  2090.      Ordinarily, you can switch among the virtual consoles
  2091. (active or inactive) by using the left Alt key in combination
  2092. with F1 through F10.  If for some reason you do not wish to have
  2093. any other virtual consoles except the first one accessible, you
  2094. can disable switching among them.  If AllowVCSwitching is called
  2095. with a True argument, switching is allowed.  Otherwise it is
  2096. suppressed.
  2097.  
  2098. See Also:
  2099.  
  2100.  
  2101. CloseWindow
  2102. Declaration:   PROCEDURE CloseWindow;
  2103.  
  2104.      Closes the most recently opened window on the console, if
  2105. any.  It will replace the text that was there before the window
  2106. was opened, keeping everything looking as nice as it can.
  2107.  
  2108. See Also: OpenWindow.
  2109.  
  2110.  
  2111. ClrEOL
  2112. Declaration:   PROCEDURE ClrEOL;
  2113.  
  2114.      Clears text from the cursor to the end of the current line.
  2115. The current text background is used to fill in the empty spaces.
  2116. Note: only performs this action on the local console, not on the
  2117. remote screen!
  2118.  
  2119. See Also: EmuClrEOL.
  2120.  
  2121.  
  2122. ClrScr
  2123. Declaration:   PROCEDURE ClrScr;
  2124.  
  2125.      Clears the local console's screen and places the cursor at
  2126. (1,1).
  2127.  
  2128. See Also: EmuClrScr.
  2129.  
  2130.  
  2131. Color constants
  2132. Declaration:   (in Const block)
  2133.  
  2134.      The following constants are defined in the VC unit for use
  2135. by calls to TextColor and TextBackground.
  2136.  
  2137.           Black     = 0       DarkGray     = 8
  2138.           Blue      = 1       LightBlue    = 9
  2139.           Green     = 2       LightGreen   = 10
  2140.           Cyan      = 3       LightCyan    = 11
  2141.           Red       = 4       LightRed     = 12
  2142.           Magenta   = 5       LightMagenta = 13
  2143.           Brown     = 6       Yellow       = 14
  2144.           LightGray = 7       White        = 15
  2145.  
  2146.           Blink = 128
  2147.  
  2148.      Using the Blink attribute by ORing it with the color used in
  2149. calls to TextBackground will cause the foreground text to blink.
  2150.  
  2151. See Also: TextBackground, TextColor.
  2152.  
  2153.  
  2154. Delay
  2155. Declaration:   PROCEDURE Delay(MS: Word);
  2156.  
  2157.      This version of Delay waits the specified number of
  2158. milliseconds before returning to the caller.  Note that this
  2159. procedure is only accurate to 55ms since it uses the system timer
  2160. tick as a measure of elapsed time.  You should use this in place
  2161. of CRT.Delay whenever you are using virtual consoles to ensure
  2162. that the background task switching keeps going while a delay is
  2163. expiring.
  2164.  
  2165. See Also: CRT.Delay.
  2166.  
  2167.  
  2168. DelLine
  2169. Declaration:   PROCEDURE DelLine;
  2170.  
  2171.      Deletes the line that the cursor is on and pulls the lines
  2172. below it up one line each.  The blank text at the bottom of the
  2173. screen is replaced with the current text background attribute.
  2174.  
  2175. See Also: EmuDelLine, InsLine.
  2176.  
  2177.  
  2178. Done
  2179. Declaration:   DESTURCTOR Done; virtual;
  2180.  
  2181.      Deallocates all of the memory associated with the virtual
  2182. console and disposes of the object.  The biggest gain in memory
  2183. terms that calling Done will give you is the freeing of the
  2184. memory which is used to store text information while the console
  2185. is in the background.
  2186.  
  2187. See Also: Init.
  2188.  
  2189.  
  2190. EmuClrEOL
  2191. Declaration:   FUNCTION EmuClrEOL: String;
  2192.  
  2193.      Returns a string containing the code required by the
  2194. emulation template to clear text from the cursor to the end of
  2195. the current line.  The blanks are filled with the current text
  2196. background.
  2197.  
  2198. See Also: ClrEOL.
  2199.  
  2200.  
  2201. EmuClrEOS
  2202. Declaration:   FUNCTION EmuClrEOS: String;
  2203.  
  2204.      Returns a string containing the code required to clear text
  2205. from the cursor to the end of the screen.
  2206.  
  2207. See Also:
  2208.  
  2209.  
  2210. EmuClrScr
  2211. Declaration:   FUNCTION EmuClrScr: String;
  2212.  
  2213.      Returns a string containing the code required to clear the
  2214. entire screen and place the cursor at coordinate (1,1).
  2215.  
  2216. See Also: ClrScr.
  2217.  
  2218.  
  2219. EmuClrTop
  2220. Declaration:   FUNCTION EmuClrTop: String;
  2221.  
  2222.      Returns a string containing the code required to clear text
  2223. from the cursor to the top of the screen.
  2224.  
  2225. See Also:
  2226.  
  2227.  
  2228. EmuColor
  2229. Declaration:   FUNCTION EmuColor(Fore, Back: Byte): String;
  2230.  
  2231.      Returns a string containing the code required to change the
  2232. current color attribute used for writing text to the local and
  2233. remote screens to a foreground color of Fore and a background
  2234. color of Back.  If you want text to blink, OR the background
  2235. color with the Blink constant.
  2236.  
  2237. See Also: TextBackground, TextColor.
  2238.  
  2239.  
  2240. EmuCursorDown
  2241. Declaration:   FUNCTION EmuCursorDown(Num: Byte): String;
  2242.  
  2243.      Returns a string containing the code required to move the
  2244. cursor down Num rows.  It will not move past the bottom of the
  2245. screen.
  2246.  
  2247. See Also: GotoXY.
  2248.  
  2249.  
  2250. EmuCursorLeft
  2251. Declaration:   FUNCTION EmuCursorLeft(Num: Byte): String;
  2252.  
  2253.      Returns a string containing the code required to move the
  2254. cursor left Num columns.  It will not move past the left edge of
  2255. the screen.
  2256.  
  2257. See Also: GotoXY.
  2258.  
  2259.  
  2260. EmuCursorRight
  2261. Declaration:   FUNCTION EmuCursorRight(Num: Byte): String;
  2262.  
  2263.      Returns a string containing the code required to move the
  2264. cursor Num columns to the right.  It will not move the cursor
  2265. past the right edge of the screen.
  2266.  
  2267. See Also: GotoXY.
  2268.  
  2269.  
  2270. EmuCursorUp
  2271. Declaration:   FUNCTION EmuCursorUp(Num: Byte): String;
  2272.  
  2273.      Returns a string containing the code required to move the
  2274. cursor up Num rows.  It will not move the cursor past the top
  2275. edge of the screen.
  2276.  
  2277. See Also: GotoXY.
  2278.  
  2279.  
  2280. EmuDelChar
  2281. Declaration:   FUNCTION EmuDelChar(Num: Byte): String;
  2282.  
  2283.      Returns a string containing the code required to delete Num
  2284. characters, starting with the one under the cursor.  It fills in
  2285. the right edge of the row with a blank, and will not wrap
  2286. characters from rows below.  The cursor does not move during this
  2287. action.
  2288.  
  2289. See Also: EmuDelLine, EmuInsChar.
  2290.  
  2291.  
  2292. EmuDelLine
  2293. Declaration:   FUNCTION EmuDelLine(Num: Byte): String;
  2294.  
  2295.      Returns a string containing the code required to delete Num
  2296. rows, starting with the one the cursor is on.  It will pull the
  2297. rows below up to fill the gap, and fill the bottom rows of the
  2298. screen with blanks.  The cursor does not move during this action.
  2299.  
  2300. See Also: DelLine, EmuDelChar, EmuInsLine.
  2301.  
  2302.  
  2303. EmuGotoXY
  2304. Declaration:   FUNCTION EmuGotoXY(ToX, ToY: Byte): String;
  2305.  
  2306.      Returns a string containing the code required to move the
  2307. cursor to the absolute coordinate (ToX,ToY).
  2308.  
  2309. See Also: GotoXY.
  2310.  
  2311.  
  2312. EmuInsChar
  2313. Declaration:   FUNCTION EmuInsChar(Num: Byte): String;
  2314.  
  2315.      Returns a string containing the code required to insert Num
  2316. characters in front of the cursor.  Characters on the end of the
  2317. row will be pushed off and lost, and will not wrap around to the
  2318. next row.  The cursor does not move during this action.
  2319.  
  2320. See Also: EmuDelChar, EmuInsLine.
  2321.  
  2322.  
  2323. EmuInsLine
  2324. Declaration:   FUNCTION EmuInsLine(Num: Byte): String;
  2325.  
  2326.      Returns a string containing the code required to insert Num
  2327. rows in front of the one the cursor is on.  Rows at the bottom
  2328. will be pushed off and lost, and the screen will not scroll.  The
  2329. cursor does not move during this action.
  2330.  
  2331. See Also: EmuDelLine, EmuInsChar, InsLine.
  2332.  
  2333.  
  2334. EmuNormal
  2335. Declaration:   FUNCTION EmuNormal: String;
  2336.  
  2337.      Returns a string containing the code required to reset the
  2338. text attributes to their "normal" values.  For virtual consoles,
  2339. default text attribute is light gray text on a black background.
  2340.  
  2341. See Also: EmuColor, EmuReverse, NormVideo.
  2342.  
  2343.  
  2344. EmuReverse
  2345. Declaration:   FUNCTION EmuReverse: String;
  2346.  
  2347.      Returns a string containing the code required to switch the
  2348. foreground and background text colors.
  2349.  
  2350. See Also: EmuColor, EmuNormal.
  2351.  
  2352.  
  2353. EmuScrollDown
  2354. Declaration:   FUNCTION EmuScrollDown(Num: Byte): String;
  2355.  
  2356.      Returns a string containing the code required to scroll the
  2357. entire screen down Num rows.  The cursor does not move during
  2358. this action.
  2359.  
  2360. See Also: EmuScrollUp.
  2361.  
  2362.  
  2363. EmuScrollUp
  2364. Declaration:   FUNCTION EmuScrollUp(Num: Byte): String;
  2365.  
  2366.      Returns a string containing the code required to scroll the
  2367. screen up Num rows.  The cursor does not move during this action.
  2368.  
  2369. See Also: EmuScrollDown.
  2370.  
  2371.  
  2372. FilterWrite
  2373. Declaration:   PROCEDURE FilterWrite(Strn: String); virtual;
  2374.  
  2375.      Writes a string of text to the console after first filtering
  2376. it through the emulation template.  This turns emulation codes
  2377. into the actual action meant by an emulation string.
  2378.      This method is virtual so that descendant objects can add
  2379. checks for special codes and/or responses.  For example, the TBBS
  2380. object overrides this to provide support for BSP and some VT-100
  2381. response functionality.
  2382.  
  2383. See Also: FilterWriteLn.
  2384.  
  2385.  
  2386. FilterWriteLn
  2387. Declaration:   PROCEDURE FilterWriteLn(Strn: String);
  2388.  
  2389.      Performs the same emulation filtering that FilterWrite does,
  2390. but adds a carriage return/linefeed pair onto the end of the
  2391. text.
  2392.  
  2393. See Also: FilterWrite.
  2394.  
  2395.  
  2396. GetScreenWord
  2397. Declaration:   PROCEDURE GetScreenWord(AtX, AtY: Byte; var
  2398.                Ch: Char; var Attr: Byte);
  2399.  
  2400.      Gets the word which defines the character and color
  2401. attribute for the cell at (AtX, AtY).  These are absolute
  2402. coordinates, and are not relative to the current window on-
  2403. screen.  On return, Ch will contain the character at that cell,
  2404. and Attr will contain the attribute byte.
  2405.  
  2406. See Also: GetText, PutScreenWord.
  2407.  
  2408.  
  2409. GetText
  2410. Declaration:   PROCEDURE GetText(X1, Y1, X2, Y2: Byte; Dest:
  2411.                Pointer);
  2412.  
  2413.      Gets a block of text data from the console's video memory
  2414. and places it in memory pointed to by Dest.  The memory must have
  2415. been allocated before the call to GetText.  You can figure out
  2416. the proper size for a given rectangle of text using either the
  2417. TextMemSize function, or by using this formula:
  2418.  
  2419.               [(X2 - X1) + 1] * [(Y2 - Y1) + 1] + 2
  2420.                                 
  2421. See Also: GetScreenWord, PutText.
  2422.  
  2423.  
  2424. GetTextBackground
  2425. Declaration:   FUNCTION GetTextBackground: Byte;
  2426.  
  2427.      Returns the current text background attribute, masked from
  2428. the TextAttr variable kept by each virtual console object.
  2429. Values with the 8th bit set (values greater than 127) have blink
  2430. enabled for text.
  2431.  
  2432. See Also: EmuColor, GetTextColor, TextBackground.
  2433.  
  2434.  
  2435. GetTextColor
  2436. Declaration:   FUNCTION GetTextColor: Byte;
  2437.  
  2438.      Returns the current text color attribute, masked from the
  2439. TextAttr variable kept by each virtual console object.
  2440.  
  2441. See Also: EmuColor, GetTextBackground, TextColor.
  2442.  
  2443.  
  2444. GotoXY
  2445. Declaration:   PROCEDURE GotoXY(ToX, ToY: Byte);
  2446.  
  2447.      Repositions the cursor at coordinate (ToX,ToY), relative to
  2448. the current window.  (1,1) is defined as the upper left hand
  2449. corner of the window.
  2450.  
  2451. See Also: EmuGotoXY.
  2452.  
  2453.  
  2454. HideTextCursor
  2455. Declaration:   PROCEDURE HideTextCursor;
  2456.  
  2457.      Hides the text cursor on the console.  Does not affect the
  2458. remote screen or any other consoles.  The method it uses to
  2459. achieve this trick is to place the ending scanline of the cursor
  2460. before the beginning scanline.  On some video cards this will
  2461. result in a split cursor, with a single scanline at the top and
  2462. bottom of the cursor cell.
  2463.  
  2464. See Also: ShowTextCursor.
  2465.  
  2466.  
  2467. HighVideo
  2468. Declaration:   PROCEDURE HighVideo;
  2469.  
  2470.      Sets the high intensity bit for foreground text only.  Does
  2471. not affect the remote terminal in any way.
  2472.  
  2473. See Also: LowVideo, NormVideo.
  2474.  
  2475.  
  2476. Init
  2477. Declaration:   CONSTRUCTOR Init;
  2478.  
  2479.      Allocates memory and sets up the virtual method table for
  2480. the object.  This method must be called before any other method
  2481. from the object can be used, or you're asking for trouble.
  2482.  
  2483. See Also: Done.
  2484.  
  2485.  
  2486. InsLine
  2487. Declaration:   PROCEDURE InsLine;
  2488.  
  2489.      Inserts a blank line where the cursor is, pushing the lines
  2490. below it down one.  The blank line is filled with the current
  2491. text attribute.
  2492.  
  2493. See Also: DelLine, EmuInsLine.
  2494.  
  2495.  
  2496. Keypressed
  2497. Declaration:   FUNCTION Keypressed: Boolean;
  2498.  
  2499.      Returns True if there are any keys waiting in the internal
  2500. key buffer for the console.  It will return False if there are no
  2501. keys waiting.
  2502.  
  2503. See Also: ReadKey.
  2504.  
  2505.  
  2506. LoadEmulation
  2507. Declaration:   FUNCTION LoadEmulation(Fname: String):
  2508.                Boolean;
  2509.  
  2510.      Attempts to load the emulation template in Fname into the
  2511. emulation template record for the console.  If it is successful,
  2512. it will return True.  Otherwise it will return False and the
  2513. previous emulation template will remain in use.
  2514.  
  2515. See Also: LoadEmulationLib.
  2516.  
  2517.  
  2518. LoadEmulationLib
  2519. Declaration:   FUNCTION LoadEmulationLib(Key, Lib: String):
  2520.                Boolean;
  2521.  
  2522.      Attempts to load the emulation template from a library file.
  2523. The library file is pointed to by Lib while Key defines the
  2524. keyname to look for in that library.  The keyname usually is the
  2525. filename which would be used if the template were in its own
  2526. file.  If it is successful, it will return True.  Otherwise it
  2527. will return False and the previous emulation template will remain
  2528. in use.
  2529.  
  2530. See Also: LoadEmulation.
  2531.  
  2532.  
  2533. LowVideo
  2534. Declaration:   PROCEDURE LowVideo;
  2535.  
  2536.      Clears the high intensity bit of the foreground color on the
  2537. local console.
  2538.  
  2539. See Also: HighVideo, NormVideo.
  2540.  
  2541.  
  2542. MaxKeyBuffer constant
  2543. Declaration:   MaxKeyBuffer = 32;
  2544.  
  2545.      This value defines the maximum number of keystrokes that are
  2546. permitted in the keyboard buffer for each virtual console.  It is
  2547. preset at 32.  This capability works by checking the DOS key
  2548. buffer at each iteration of the main system task, and putting
  2549. keystrokes into the current console's buffer.  Note that an
  2550. extended keypress, such as PgUp, actually represents two
  2551. keystrokes, the null (#0) prefix character and the actual key
  2552. code.
  2553.      This value must be a power of 2 due to the way the code
  2554. handles the array wraparound.
  2555.  
  2556. See Also:
  2557.  
  2558.  
  2559. NormVideo
  2560. Declaration:   PROCEDURE NormVideo;
  2561.  
  2562.      Changes the text attribute to the default of light gray text
  2563. on a black background.
  2564.  
  2565. See Also: HighVideo, LowVideo.
  2566.  
  2567.  
  2568. OpenWindow
  2569. Declaration:   PROCEDURE OpenWindow(X1, Y1, Width, Height,
  2570.                Fore, Back: Byte; Border: TBorder; Title:
  2571.                String);
  2572.  
  2573.      Opens a text window on the screen using the parameters given
  2574. to it.  (X1,Y1) defines the upper left corner of the window, in
  2575. absolute coordinates.  Width and Height are the width and height
  2576. of the writable area of the window.  This does not include the
  2577. border, if any.  Fore and Back are the default colors used by the
  2578. window, which allow you to give it an appearance more like a
  2579. window.  Border defines the type of border used, if any.  Title
  2580. is the default title for the window, which will only be visible
  2581. if the window has a border.
  2582.      Note that windows which are opened are closed in reverse
  2583. order, and there is currently no support for switching among
  2584. multiple overlapping windows.
  2585.  
  2586. See Also: CloseWindow, TBorder type.
  2587.  
  2588.  
  2589. PutScreenWord
  2590. Declaration:   PROCEDURE PutScreenWord(AtX, AtY: Byte; Ch:
  2591.                Char; Attr: Byte);
  2592.  
  2593.      Puts a character and attribute combination directly into the
  2594. console's video memory at the character cell defined by
  2595. (AtX,AtY).  This coordinate is absolute and is not affected by
  2596. any active windows.
  2597.  
  2598. See Also: GetScreenWord, PutText.
  2599.  
  2600.  
  2601. PutText
  2602. Declaration:   PROCEDURE PutText(AtX, AtY: Byte; Source:
  2603.                Pointer);
  2604.  
  2605.      Puts a block of text previously saved with a call to GetText
  2606. directly into the console's video memory.  The upper left corner
  2607. of the block is defined by (AtX,AtY).  This coordinate is
  2608. absolute and is not affected by any active windows on the
  2609. console.
  2610.  
  2611. See Also: GetText, PutScreenWord.
  2612.  
  2613.  
  2614. ReadKey
  2615. Declaration:   FUNCTION ReadKey: Char;
  2616.  
  2617.      Patiently waits for a character to appear in the console
  2618. keyboard buffer and then returns it.  ReadKey is task switching
  2619. friendly and will continue to switch among background tasks while
  2620. it is waiting for a character to appear in the buffer.
  2621.  
  2622. See Also: Keypressed, vcReadLn.
  2623.  
  2624.  
  2625. SetWindowTitle
  2626. Declaration:   PROCEDURE SetWindowTitle(Title: String);
  2627.  
  2628.      Changes the window title to a new string.  This is updated
  2629. on-screen immediately.
  2630.  
  2631. See Also: OpenWindow.
  2632.  
  2633.  
  2634. ShowTextCursor
  2635. Declaration:   PROCEDURE ShowTextCursor;
  2636.  
  2637.      Unhides the text cursor on the console by redefining the
  2638. cursor dimensions back to the defaults for the type of card found
  2639. on the system.  Usually this is the bottom two scanlines of the
  2640. cursor.
  2641.  
  2642. See Also: HideTextCursor.
  2643.  
  2644.  
  2645. SystemLoad variable
  2646. Declaration:   SystemLoad: Real;
  2647.  
  2648.      The value in this variable is an attempt to mimic the UNIX
  2649. 'uptime' command, which provides a number representing the
  2650. current load being placed on the system.  This version of the
  2651. load is a measure of how many milliseconds elapse between
  2652. iterations of the system task.  The lower the number the better.
  2653. It is provided for amusement only, and has not undergone much
  2654. rigorous testing.
  2655.  
  2656. See Also:
  2657.  
  2658.  
  2659. TBorder type
  2660. Declaration:   TBorder = (NoBorder, SingleLine, SingleTop,
  2661.                DoubleLine, DoubleTop);
  2662.  
  2663.      TBorder is an enumerated type used by the
  2664. TVirtualConsole.OpenWindow method.  It defines the type of border
  2665. which will be used for the new window, if any.
  2666.  
  2667. See Also: TVirtualConsole.OpenWindow.
  2668.  
  2669.  
  2670. TEmulation record
  2671. Declaration:   TEmulation = record
  2672.                  Name    : String[20];
  2673.  
  2674.                  Key     : String[8];
  2675.                  Header  : String[3];
  2676.                  Offset  : Byte;
  2677.                  XYOrder : Boolean;
  2678.                  ClrEOL  : TCmdStr;
  2679.                  ClrEOS  : TCmdStr;
  2680.                  ClrScr  : TCmdStr;
  2681.                  ClrTop  : TCmdStr;
  2682.                  Color   : TCmdStr;
  2683.                  CursDn  : TCmdStr;
  2684.                  CursLf  : TCmdStr;
  2685.                  CursRt  : TCmdStr;
  2686.                  CursUp  : TCmdStr;
  2687.                  DelLine : TCmdStr;
  2688.                  DelChar : TCmdStr;
  2689.                  GotoXY  : TCmdStr;
  2690.                  InsChar : TCmdStr;
  2691.                  InsLine : TCmdStr;
  2692.                  Normal  : TCmdStr;
  2693.                  Reverse : TCmdStr;
  2694.                  ScrlDn  : TCmdStr;
  2695.                  ScrlUp  : TCmdStr;
  2696.                end;
  2697.  
  2698.      This record holds the information for an emulation template.
  2699. The TCmdStr type is defined as
  2700.  
  2701.           TCmdStr = String[2];
  2702.           
  2703.      Each member of the record is described in more detail below.
  2704.  
  2705.           Name      Long name of the emulation template.
  2706.           Key       Keyname, usually the same as the DOS
  2707.                     filename.
  2708.           Header    Header, if any, sent before each
  2709.                     emulation code.
  2710.           Offset    Offset for computing GotoXY codes.
  2711.           XYOrder   True = X,Y; False = Y,X
  2712.           ClrEOL    Clear cursor to end of line.
  2713.           ClrEOS    Clear cursor to end of screen.
  2714.           ClrScr    Clear screen.
  2715.           ClrTop    Clear cursor to top of screen.
  2716.           Color     Change color.
  2717.           CursDn    Cursor down.
  2718.           CursLf    Cursor left.
  2719.           CursRt    Cursor right.
  2720.           CursUp    Cursor up.
  2721.           DelChar   Delete character at the cursor, pull
  2722.                     line left.
  2723.           DelLine   Delete line with cursor, pull lines up.
  2724.           GotoXY    Move cursor to absolute coordinates.
  2725.           InsChar   Insert blank at cursor, push line right.
  2726.           InsLine   Insert line in front of cursor, push
  2727.                     lines down.
  2728.           Normal    Switch to normal text attributes.
  2729.           Reverse   Switch to reversed text attributes.
  2730.           ScrlDn    Scroll screen down a line, insert blank
  2731.                     line at top.
  2732.           ScrlUp    Scroll screen up a line, insert blank
  2733.                     line at bottom.
  2734.  
  2735.      This record exists is each of the virtual console objects.
  2736. To get a command, you should use the EmuXXX methods instead of
  2737. directly accessing this record structure.
  2738.  
  2739. See Also: EmuXXX methods.
  2740.  
  2741.  
  2742. TextBackground
  2743. Declaration:   PROCEDURE TextBackground(Color: Byte);
  2744.  
  2745.      Sets the background color used when writing characters to
  2746. the display.  This value can range from 0 to 7.  You can OR this
  2747. value with the Blink constant to force the text to blink on and
  2748. off.
  2749.  
  2750. See Also: GetTextBackground, TextColor.
  2751.  
  2752.  
  2753. TextColor
  2754. Declaration:   PROCEDURE TextColor(Color: Byte);
  2755.  
  2756.      Sets the foreground color for text written to the console's
  2757. display.  This value can range from 0 to 15, or you can use the
  2758. constants provided in the VC unit.  If you want blinking
  2759. characters, you can set them by ORing the color byte with the
  2760. Blink constant.
  2761.  
  2762. See Also: GetTextColor, TextBackground.
  2763.  
  2764.  
  2765. TextMode
  2766. Declaration:   PROCEDURE TextMode(ToMode: Integer);
  2767.  
  2768.      Switches the console text mode somewhat like the CRT unit's
  2769. procedure by the same name.  The only restriction placed on the
  2770. virtual console is that the width of the display must always be
  2771. 80.  This basically means you cannot change the mode on the CGA,
  2772. and can choose between 80x25 and 80x43 on the EGA, and 80x25 or
  2773. 80x50 on the VGA.
  2774.  
  2775. See Also: LastMode variable.
  2776.  
  2777.  
  2778. TranslateString
  2779. Declaration:   PROCEDURE TranslateString;
  2780.  
  2781.      Tries to translate the current filter information into a
  2782. legal emulation sequence.  If it can, it will go and perform
  2783. whatever action is defined for the code(s) in the string.
  2784. Otherwise it will send the text to the console.
  2785.  
  2786. See Also: ValidString.
  2787.  
  2788.  
  2789. TStaticCollection type
  2790. Declaration:   TStaticCollection = object(TCollection)
  2791.  
  2792.      TStaticCollection is a descendent form of the TCollection
  2793. object provided in the Objects unit of Turbo Pascal versions 6.0
  2794. and newer.  TCollection is a dynamic array which allows the
  2795. programming to add variables of any type and size to an array
  2796. which will grow or shrink according to its elements.
  2797.      Ordinarily, TCollection will compress the elements of the
  2798. collection after a item is removed from the collection.
  2799. TStaticCollection alters this behavior to not compress the
  2800. elements of the collection, but to rather just store a nil
  2801. pointer at that index.  Additionally, TCollection.Insert will
  2802. simply insert the new item at the end of the collection, while
  2803. TStaticCollection first searches for an empty (nil) slot and will
  2804. place the new item there is one is found.  TStaticCollection
  2805. modifies the Done, AtDelete and Insert methods.
  2806.      TStaticCollection is used by the VC unit to keep an internal
  2807. list of the active virtual consoles and the pointers to their
  2808. objects.
  2809.  
  2810. See Also: Objects.TCollection.
  2811.  
  2812.  
  2813. TValidStr type
  2814. Declaration:   TValidStr = (Yes, No, Maybe);
  2815.  
  2816.      This enumerated type is used by the ValidString method to
  2817. return the status of a possible emulation code.
  2818.  
  2819. See Also: ValidString.
  2820.  
  2821.  
  2822. TVirtualConsole variables
  2823. Declaration:   Var
  2824.                  ANSI      : Boolean;
  2825.                  Emu       : TEmulation;
  2826.                  FilterStr : String[80];
  2827.                  LastMode  : Integer;
  2828.                  TextAttr  : Byte;
  2829.                  WindMax   : Word;
  2830.                  WindMin   : Word;
  2831.                  WinList   : TCollection;
  2832.  
  2833. t
  2834. the TVirtualConsole object.  They may be accessed in descendant
  2835. objects as well, just be careful!
  2836.  
  2837. ANSI      True if the current emulation template is ANSI-
  2838.           style.
  2839. Emu       Emulation template record.
  2840. FilterStr Contains the current possible emulation code.
  2841. LastMode  Last text mode that the console was in.
  2842. TextAttr  Current text attribute byte.
  2843. WindMax   Current window maximum coordinates.
  2844. WindMin   Current window minimum coordinates.
  2845. WinList   TCollection of the active windows on-screen.
  2846.  
  2847.      WindMax and WindMin are constructed exactly like they are in
  2848. the CRT unit; check your manuals for more information on how
  2849. these variables are used.
  2850.      These variables are, for the most part, volatile.  Don't
  2851. change their values unless you are indirectly doing it through
  2852. one of the virtual console methods, or bad things will start
  2853. happening to your video display (the text screen, that is).
  2854.  
  2855. See Also: CRT.WindMax, CRT.WindMin.
  2856.  
  2857.  
  2858. TWindow type
  2859. Declaration:   TWindow = record
  2860.                  X1, Y1       : Byte;
  2861.                  Width, Height: Byte;
  2862.                  Border       : TBorder;
  2863.                  TextMem      : Pointer;
  2864.                  WMin, WMax   : Word;
  2865.                  OldColors    : Byte;
  2866.                  OldX, OldY   : Byte;
  2867.                  Title        : String;
  2868.                end;
  2869.  
  2870.      These variables keep track of an active window on a virtual
  2871. console, if any.  The entire screen does not count as an active
  2872. window.  Windows are created with the OpenWindow method and
  2873. removed using the CloseWindow method.
  2874.  
  2875. See Also: CloseWindow, OpenWindow, SetWindowTitle.
  2876.  
  2877.  
  2878. ValidString
  2879. Declaration:   FUNCTION ValidString: TValidStr;
  2880.  
  2881.      Returns Yes, No or Maybe, depending on the filter string
  2882. currently in memory.  If the filter string is a valid emulation
  2883. code (and only one), it will return Yes.  If there is any
  2884. possibility that the code is part of what would be a legal
  2885. emulation string, it will return Maybe.  Otherwise it will return
  2886. No.
  2887.  
  2888. See Also: TranslateString, TValidStr.
  2889.  
  2890.  
  2891. vcReadLn
  2892. Declaration:   PROCEDURE vcReadLn(var Strn: String);
  2893.  
  2894.      Reads a line of text from the console.  Note that this
  2895. version is more restricted than the version provided with the CRT
  2896. unit.  It will only read strings of text and can only read from
  2897. the local console.  If you need to read from a file, you should
  2898. use the CRT unit's ReadLn procedure.  It is for this reason that
  2899. this method was prefixed with a "vc" in it's name.
  2900.  
  2901. See Also: CRT.ReadLn, ReadKey.
  2902.  
  2903.  
  2904. vcWrite
  2905. Declaration:   PROCEDURE vcWrite(Strn: String);
  2906.  
  2907.      Writes a string of text to the virtual console.  Does not
  2908. filter it through the emulation template; if you need this
  2909. functionality use the FilterWrite and FilterWriteLn methods.  The
  2910. only other restrictions are that it can only handle strings, and
  2911. it cannot send text to any device except the console.  If you
  2912. need to write variables to a file, use the CRT unit's Write or
  2913. WriteLn procedures instead.
  2914.  
  2915. See Also: FilterWrite, FilterWriteLn, vcWriteLn.
  2916.  
  2917.  
  2918. vcWriteLn
  2919. Declaration:   PROCEDURE vcWriteLn(Strn: String);
  2920.  
  2921.      Writes a string of text to the console, ending by placing
  2922. the cursor in the first column of the next row and scrolling the
  2923. screen if necessary.  Does not filter through the emulation
  2924. template; use FilterWriteLn if you need this functionality.
  2925.  
  2926. See Also: FilterWriteLn, vcWrite.
  2927.  
  2928.  
  2929. WhereX
  2930. Declaration:   FUNCTION WhereX: Byte;
  2931.  
  2932.      Returns the current X coordinate, relative to the current
  2933. window.  The left edge is defined as column 1.
  2934.  
  2935. See Also: GotoXY, WhereY.
  2936.  
  2937.  
  2938. WhereY
  2939. Declaration:   FUNCTION WhereY: Byte;
  2940.  
  2941.      Returns the current Y coordinate, relative to the current
  2942. window.  The top edge is defined as row 1.
  2943.  
  2944. See Also: GotoXY, WhereX.
  2945.  
  2946.  
  2947. Window
  2948. Declaration:   PROCEDURE Window(X1, Y1, X2, Y2: Byte);
  2949.  
  2950.      Defines a window on the screen for the console.  This new
  2951. window will be the only area of the screen which can be written
  2952. to, until Window is called again with new coordinates.  To set
  2953. the window back to use the whole screen, use Window(1, 1,
  2954. Lo(WindMax) + 1, Hi(WindMax) + 1).
  2955.  
  2956. See Also: OpenWindow.
  2957.  
  2958.  
  2959. WindowHeight
  2960. Declaration:   FUNCTION WindowHeight: Byte;
  2961.  
  2962.      Returns the height of the current text window opened using
  2963. either the Window or OpenWindow methods.
  2964.  
  2965. See Also: WindowWidth.
  2966.  
  2967.  
  2968. WindowWidth
  2969. Declaration:   FUNCTION WindowWidth: Byte;
  2970.  
  2971.      Returns the width of the current text window opened using
  2972. either the Window or OpenWindow methods.
  2973.  
  2974. See Also: WindowHeight.
  2975.                           Chapter 9: Procedure/Function Reference
  2976.                                                                  
  2977.  
  2978.  
  2979. AltDown                                                 Util
  2980. Declaration:   FUNCTION AltDown: Boolean;
  2981.  
  2982.      Returns True if either of the alt keys is being held down at
  2983. the time of the call.
  2984.  
  2985. See Also: LeftAltDown, RightAltDown.
  2986.  
  2987.  
  2988. Backspace                                               Util
  2989. Declaration:   FUNCTION Backspace(Num: Byte): String;
  2990.  
  2991.      Returns Num backspace characters (#8) in string form.
  2992.  
  2993. See Also: Replicate.
  2994.  
  2995.  
  2996. BitIsSet                                                Util
  2997. Declaration:   FUNCTION BitIsSet(Value, Bit: Byte): Boolean;
  2998.  
  2999.      Returns True if a bit is set in the byte Value passed to the
  3000. function.  Bit must be a number between 0 and 7, inclusive.  A 0
  3001. corresponds to the least significant bit in the 8-bit value, a 7
  3002. is the most significant bit.
  3003.  
  3004. See Also: ClearBit, SetBit.
  3005.  
  3006.  
  3007. BpsRate                                                 Comm
  3008. Declaration:   FUNCTION BpsRate(PortIdx: Byte): Longint;
  3009.  
  3010.      Returns the current bits per second (bps) rate of the
  3011. specified COM port.  Sometimes the bps rate is referred to as the
  3012. baud rate.
  3013.  
  3014. See Also: SetBpsRate.
  3015.  
  3016.  
  3017. Button type                                            Mouse
  3018. Declaration:   Button = (NoB, LeftB, RightB, BothB);
  3019.  
  3020.      Button status type for calls to the mouse interface unit.
  3021.  
  3022. See Also:
  3023.  
  3024.  
  3025. CapsLock                                                Util
  3026. Declaration:   FUNCTION CapsLock: Boolean;
  3027.  
  3028.      Returns True if caps lock is enabled.
  3029.  
  3030. See Also: NumLock, ScrollLock.
  3031.  
  3032.  
  3033. Carrier                                                 Comm
  3034. Declaration:   FUNCTION Carrier(PortIdx: Byte): Boolean;
  3035.  
  3036.      Returns True if a carrier exists on the specified COM port,
  3037. False otherwise.
  3038.  
  3039. See Also: ModemError, ErrXXX constants.
  3040.  
  3041.  
  3042. Center                                                  Util
  3043. Declaration:   FUNCTION Center(Strn: String): String;
  3044.  
  3045.      Returns a string which would be Strn centered the current
  3046. text window.  Note that this only works for the CRT text window,
  3047. and not text windows on a virtual console.  This is accomplished
  3048. using space padding on the left of the string.  The string is not
  3049. stripped of whitespace before being padded.
  3050.  
  3051. See Also: Left, Right.
  3052.  
  3053.  
  3054. ClearBit                                                Util
  3055. Declaration:   PROCEDURE ClearBit(var Value: Byte; Bit:
  3056.                Byte);
  3057.  
  3058.      Clears a bit in the byte Value.  Bit must be a number
  3059. between 0 and 7, inclusive, where 0 signifies the least
  3060. significant bit and 7 the most significant bit.
  3061.  
  3062. See Also: BitIsSet, SetBit.
  3063.  
  3064.  
  3065. ClearPort                                               Comm
  3066. Declaration:   PROCEDURE ClearPort(PortIdx: Byte);
  3067.  
  3068.      Attempts to clear the COM port by reading and clearing some
  3069. of the UART registers.  Specifically it reads RBR, LSR and MSR,
  3070. and toggles the IER in case interrupts have somehow to been lost.
  3071.  
  3072. See Also: UART constants.
  3073.  
  3074.  
  3075. ClearReceiveBuffer                                      Comm
  3076. Declaration:   PROCEDURE ClearReceiveBuffer(PortIdx: Byte);
  3077.  
  3078.      Empties the receive buffer of any waiting characters.
  3079.  
  3080. See Also: ClearSendBuffer.
  3081.  
  3082.  
  3083. ClearSendBuffer                                         Comm
  3084. Declaration:   PROCEDURE ClearSendBuffer(PortIdx: Byte);
  3085.  
  3086.      Empties the send buffer of any unsent characters.
  3087.  
  3088. See Also: ClearReceiveBuffer, FlushSendBuffer.
  3089.  
  3090.  
  3091. ClearToSend                                             Comm
  3092. Declaration:   FUNCTION ClearToSend(PortIdx: Byte): Boolean;
  3093.  
  3094.      Returns the status of the clear to send (CTS) bit in the
  3095. modem status register.  This is used for hardware handshaking.
  3096. If True, it means that the remote modem is ready to accept
  3097. incoming characters (your modem is clear to send).  If False, the
  3098. remote modem is not ready and characters should not be sent until
  3099. the bit is toggled.
  3100.  
  3101. See Also: SetRTS.
  3102.  
  3103.  
  3104. Color variable                                          Util
  3105. Declaration:   Color: Boolean;
  3106.  
  3107.      This variable is set at program startup.  It is True if a
  3108. color display is in use, False for monochrome.
  3109.  
  3110. See Also: VSeg.
  3111.  
  3112.  
  3113. CommandLine                                             Util
  3114. Declaration:   FUNCTION CommandLine(Strn: String): Boolean;
  3115.  
  3116.      Returns True if the literal string Strn exists in the
  3117. command line in its entirety.  This means that you must be
  3118. looking for an exact match, not a partial match.
  3119.  
  3120. See Also: CommandLineValue, InCommandLine.
  3121.  
  3122.  
  3123. CommandLineValue                                        Util
  3124. Declaration:   FUNCTION CommandLineValue(Strn: String):
  3125.                String;
  3126.  
  3127. o
  3128. of the text coming after /H= in the command line.  It will match
  3129. the first parameter it finds and return that string only.
  3130.  
  3131. See Also: CommandLine, InCommandLine.
  3132.  
  3133.  
  3134. ConfineMouseX                                          Mouse
  3135. Declaration:   PROCEDURE ConfineMouseX(Left, Right:
  3136.                Integer);
  3137.  
  3138.      Restricts mouse movement to a region bound on the left and
  3139. right.  You should call this procedure (or ConfineScreen) after
  3140. any mode changes to assure that the mouse has full run of the
  3141. screen.  Alternatively, you can restrict mouse movement to a
  3142. small region of the screen where you wish the user to be able to
  3143. move the cursor.
  3144.  
  3145. See Also: ConfineMouseY, ConfineScreen.
  3146.  
  3147.  
  3148. ConfineMouseY                                          Mouse
  3149. Declaration:   PROCEDURE ConfineMouseY(Top, Bot: Integer);
  3150.  
  3151.      Restricts mouse movement to a region bound on the top and
  3152. bottom.  You should call this procedure (or ConfineScreen) after
  3153. any mode changes to assure that the mouse has full run of the
  3154. screen.  Alternatively, you can restrict mouse movement to a
  3155. small region of the screen where you wish the user to be able to
  3156. move the cursor.
  3157.  
  3158. See Also: ConfineMouseX, ConfineScreen.
  3159.  
  3160.  
  3161. ConfineScreen                                          Mouse
  3162. Declaration:   PROCEDURE ConfineScreen;
  3163.  
  3164.      Confines the mouse cursor to the entire screen of the
  3165. current video mode.  This assures that the mouse is able to move
  3166. over the whole screen, without disappearing off the edges.
  3167.  
  3168. See Also: ConfineMouseX, ConfineMouseY.
  3169.  
  3170.  
  3171. ControlDown                                             Util
  3172. Declaration:   FUNCTION ControlDown: Boolean;
  3173.  
  3174.      Returns True if either control key is being held down when
  3175. the function is called.
  3176.  
  3177. See Also: LeftControlDown, RightControlDown.
  3178.  
  3179.  
  3180. CopyFile                                                Util
  3181. Declaration:   FUNCTION CopyFile(Source, Dest: String):
  3182.                Boolean;
  3183.  
  3184.      Copies a file from the source to either a destination file
  3185. or destination directory.  If you specify a destination
  3186. directory, the filename used for the copy will be the same as the
  3187. source.  If this file exists in the destination directory
  3188. already, CopyFile will return a False value.
  3189.      Otherwise, if you tell it a specific file to copy to, it
  3190. will overwrite it if it already exists.
  3191.      CopyFile will return True if there were no errors during the
  3192. copy, False otherwise.  A False value generally means that there
  3193. was some problem with disk I/O.
  3194.  
  3195. See Also:
  3196.  
  3197.  
  3198. CountryInfo variable                                    Util
  3199. Declaration:   CountryInfo: TCountryInfo;
  3200.  
  3201.      This variable is set to the local country values at program
  3202. startup by calling GetCountryInfo(CountryInfo).  If you only wish
  3203. to check the local information quickly, there is no need to call
  3204. GetCountryInfo and go through a slow DOS interrupt.
  3205.  
  3206. See Also: GetCountryInfo, TCountryInfo record.
  3207.  
  3208.  
  3209. CPU variable                                            Util
  3210. Declaration:   CPU: Byte;
  3211.  
  3212.      Contains the value returned by Processor for the current
  3213. machine.  This variable is set at program startup.
  3214.  
  3215. See Also: Processor, Test8086.
  3216.  
  3217.  
  3218. DataTerminalReady                                       Comm
  3219. Declaration:   FUNCTION DataTerminalReady(PortIdx: Byte):
  3220.                Boolean;
  3221.  
  3222.      Returns the status of the DTR bit in the modem control
  3223. register.  Most modems will not accept commands or send & receive
  3224. characters if the DTR bit is not set.  Additionally, some modems
  3225. will interpret a low DTR line as a request to put the modem on-
  3226. hook (hung up).
  3227.  
  3228. See Also: SetDTR.
  3229.  
  3230.  
  3231. Date                                                    Util
  3232. Declaration:   FUNCTION Date: String;
  3233.  
  3234.      Returns the date in a nicely formatted way, paying attention
  3235. to country information if it exists when DOS is queried for it.
  3236. Country information affects the order in which the date is
  3237. presented.  Programs run in the USA will return MM/DD/YY, when
  3238. run in Europe it will return DD/MM/YY, and when run in Japan it
  3239. will return YY/MM/DD.  The date separator also varies depending
  3240. on the country information.  You can change country info using
  3241. COUNTRY.SYS if needed.
  3242.  
  3243. See Also: Time.
  3244.  
  3245.  
  3246. DeInitPort                                              Comm
  3247. Declaration:   PROCEDURE DeInitPort(PortIdx: Byte);
  3248.  
  3249.      Shuts the COM port down.  Removes all the interrupt hooks
  3250. from the interrupt vector, disables interrupts on that COM port,
  3251. frees the memory taken up by the send and receive buffers, and
  3252. exits.  The port will no longer be serviced by the comm routines.
  3253.  
  3254. See Also: InitPort.
  3255.  
  3256.  
  3257. DetectPort                                              Comm
  3258. Declaration:   FUNCTION DetectPort(PortIdx: Byte): Boolean;
  3259.  
  3260.      Attempts to detect whether or not a National-based UART
  3261. exists at the specified COM port.  It will run the standard
  3262. loopback test on the COM port and, if successful, will return a
  3263. True value.  If a valid National-based UART cannot be found, it
  3264. will return False.
  3265.      Note that more and more internal modem manufacturers are
  3266. using a UART chip that does not appear to be 100% compatible with
  3267. the National 8250B, and will fail this test even though the UART
  3268. works in all other respects.
  3269.  
  3270. See Also: DetectUART.
  3271.  
  3272.  
  3273. DetectUART                                              Comm
  3274. Declaration:   FUNCTION DetectUART(PortIdx: Byte): String;
  3275.  
  3276.      Attempts to detect which National-based UART exists at the
  3277. specified port.  It is assumed at the top of this procedure that
  3278. a UART does exist at the COM port, so no checking is done in this
  3279. respect.  If you are not sure of the existence of a COM port, use
  3280. DetectPort first.
  3281.      DetectUART will return a string describing the type of UART
  3282. found at the COM port:
  3283.  
  3284. 8250B     National 8250B or compatible (no scratch register,
  3285.           no FIFOs).
  3286. 16450     National 16450 or compatible (scratch register, no
  3287.           FIFOs).
  3288. 16550     National 16550 or compatible (scratch register, no
  3289.           working FIFOs).
  3290. 16550A    National 16550A or compatible (scratch register,
  3291.           working FIFOs).
  3292.  
  3293.      Please note that the original National 16550 UART found in
  3294. early IBM PS/2's did not have working FIFO buffers for send or
  3295. receive, and subsequently should be treated as a National 16450
  3296. UART.
  3297.  
  3298. See Also: DetectPort.
  3299.  
  3300.  
  3301. ErrXXX constants                                        Comm
  3302. Declaration:   (in Const block)
  3303.  
  3304.      These constants are used to check the error flag for any of
  3305. the comports.  To get the error flag, use the ModemError function
  3306. and these constants to mask out the different events.
  3307.  
  3308. ErrInputOverflow  = $01  Signals that the receive buffer was
  3309.                          full when another character came
  3310.                          in.
  3311. ErrOutputOverflow = $02  Signals that the send buffer was
  3312.                          full when you tried to send another
  3313.                          character out.
  3314. ErrInactivity     = $04  Signals that the user was inactive
  3315.                          for an extended period of time.
  3316. ErrOverrun        = $08  An overrun error occurred at the
  3317.                          UART.  This means that before a
  3318.                          character was fetched from the
  3319.                          receive buffer register, another
  3320.                          character was ready to be stored
  3321.                          there.
  3322. ErrParity         = $10  The UART detected a parity error on
  3323.                          the incoming byte.
  3324. ErrFraming        = $20  The UART detected a framing error
  3325.                          on the incoming byte.
  3326. ErrCarrierLost    = $40  Carrier no longer exists when it
  3327.                          once did.  Useful for catching
  3328.                          people who hang up on the system.
  3329. ErrBreakSignal    = $80  The UART detected a break signal.
  3330.  
  3331. See Also: ModemError.
  3332.  
  3333.  
  3334. Exist                                                   Util
  3335. Declaration:   FUNCTION Exist(Filename: String): Boolean;
  3336.  
  3337.      Returns True if the file exists, False if it doesn't.
  3338.  
  3339. See Also:
  3340.  
  3341.  
  3342. FillWord                                                Util
  3343. Declaration:   PROCEDURE FillWord(Dest: Pointer; Value, Len:
  3344.                Word);
  3345.  
  3346.      Fills a block of memory Len bytes long with the word in
  3347. Value.  This performs the same operation as FillChar does, but
  3348. moves twice as much information in the same space of time.
  3349.  
  3350. See Also: System.FillChar.
  3351.  
  3352.  
  3353. FlushSendBuffer                                         Comm
  3354. Declaration:   PROCEDURE FlushSendBuffer(PortIdx: Byte);
  3355.  
  3356.      Repeatedly loops until it sees that all of the characters
  3357. waiting in the send buffer have been sent out the UART, and
  3358. returns.  Note that this is different that calling
  3359. ClearSendBuffer because the characters are given a chance to be
  3360. sent, and are not thrown away instead.
  3361.  
  3362. See Also: ClearSendBuffer.
  3363.  
  3364.  
  3365. GetCountryInfo                                          Util
  3366. Declaration:   PROCEDURE GetCountryInfo(var InfoRec:
  3367.                TCountryInfo);
  3368.  
  3369.      Retrieves country information from DOS.  This procedure
  3370. requires the use of DOS 3.3 or newer.
  3371.  
  3372. See Also: CountryInfo variable, TCountryInfo record.
  3373.  
  3374.  
  3375. GetDirectory                                            Util
  3376. Declaration:   FUNCTION GetDirectory(Str: String): DirStr;
  3377.  
  3378.      Strips the directory out of a fully qualified pathname and
  3379. returns it.
  3380.  
  3381. See Also: GetExtension, GetFilename.
  3382.  
  3383.  
  3384. GetExtension                                            Util
  3385. Declaration:   FUNCTION GetExtension(Str: String): ExtStr;
  3386.  
  3387.      Strips the extension out of a filename and returns it.
  3388. There is a preceding period (.) before the actual three-letter
  3389. extension.
  3390.  
  3391. See Also: GetDirectory, GetFilename.
  3392.  
  3393.  
  3394. GetFilename                                             Util
  3395. Declaration:   FUNCTION GetFilename(Str: String): NameStr;
  3396.  
  3397.      Strips the name out of a filename and returns it.  This is
  3398. the 8-letter portion of the filename, without the extension.
  3399.  
  3400. See Also: GetDirectory, GetExtension.
  3401.  
  3402.  
  3403. GetFlowControl                                          Comm
  3404. Declaration:   PROCEDURE GetFlowControl(PortIdx: Byte; var
  3405.                XonXoff, RTSCTS: Boolean);
  3406.  
  3407.      Gets the current flow control settings for the COM port.
  3408. XonXoff and RTSCTS are boolean variables which return the status
  3409. of that type of handshaking.
  3410.      XonXoff is software handshaking and requires the use of two
  3411. characters for starting/stopping the flow of data.  Typically ^S
  3412. is used to stop the flow, and ^Q is used to restart it.  RTSCTS
  3413. uses two hardware lines for flow control, and is transparent to
  3414. the entire 8-bit character set.
  3415.  
  3416. See Also: SetFlowControl.
  3417.  
  3418.  
  3419. GetMouseAction                                         Mouse
  3420. Declaration:   PROCEDURE GetMouseAction(var But: Button; var
  3421.                X, Y: Integer);
  3422.  
  3423.      Returns the current status of the mouse.  But contains the
  3424. button status, X contains the X coordinate of the mouse cursor,
  3425. and Y contains the Y coordinate of the mouse cursor.
  3426.  
  3427. See Also: MoveMouse.
  3428.  
  3429.  
  3430. GetScreenWord                                           Util
  3431. Declaration:   PROCEDURE GetScreenWord(X, Y: Byte; var Ch:
  3432.                Char; var Attr: Byte);
  3433.  
  3434.      Gets the word which defines the character and color
  3435. attribute for the cell at (X, Y).  These are absolute
  3436. coordinates, and are not relative to the current window on-
  3437. screen.  On return, Ch will contain the character at that cell,
  3438. and Attr will contain the attribute byte.
  3439.  
  3440. See Also: PutScreenWord, GetText.
  3441.  
  3442.  
  3443. GetText                                                 Util
  3444. Declaration:   PROCEDURE GetText(X1, Y1, X2, Y2: Byte; Dest:
  3445.                Pointer);
  3446.  
  3447.      Gets a block of text data from the console's video memory
  3448. and places it in memory pointed to by Dest.  The memory must have
  3449. been allocated before the call to GetText.  You can figure out
  3450. the proper size for a given rectangle of text using either the
  3451. TextMemSize function, or by using this formula:
  3452.  
  3453.               [(X2 - X1) + 1] * [(Y2 - Y1) + 1] + 2
  3454.                                 
  3455. See Also: GetScreenWord, PutText.
  3456.  
  3457.  
  3458. HexByte                                                 Util
  3459. Declaration:   FUNCTION HexByte(Num: Byte): String;
  3460.  
  3461.      Returns the two character hexadecimal value of Num.
  3462.  
  3463. See Also: HexLongint, HexWord.
  3464.  
  3465.  
  3466. HexLongint                                              Util
  3467. Declaration:   FUNCTION HexLongint(Num: Longint): String;
  3468.  
  3469.      Returns the eight character hexadecimal value of Num.
  3470.  
  3471. See Also: HexByte, HexWord.
  3472.  
  3473.  
  3474. HexWord                                                 Util
  3475. Declaration:   FUNCTION HexWord(Num: Word): String;
  3476.  
  3477.      Returns the four character hexadecimal value of Num.
  3478.  
  3479. See Also: HexByte, HexLongint.
  3480.  
  3481.  
  3482. HideMouseCursor                                        Mouse
  3483. Declaration:   PROCEDURE HideMouseCursor;
  3484.  
  3485.      Hides the mouse cursor if it isn't already hidden.
  3486.  
  3487. See Also: ShowMouseCursor.
  3488.  
  3489.  
  3490. HideTextCursor                                          Util
  3491. Declaration:   PROCEDURE HideTextCursor;
  3492.  
  3493.      Hides the text cursor on the local screen.
  3494.  
  3495. See Also: ShowTextCursor.
  3496.  
  3497.  
  3498. HighNybble                                              Util
  3499. Declaration:   FUNCTION HighNybble(A: Byte): Byte;
  3500.  
  3501.      Returns the high 4 bits of a byte value.  Example:
  3502. HighNybble($AB) returns $A.
  3503.  
  3504. See Also: LowNybble.
  3505.  
  3506.  
  3507. InCommandLine                                           Util
  3508. Declaration:   FUNCTION InCommandLine(Strn: String): Byte;
  3509.  
  3510.      Searches for the first substring match of Strn within the
  3511. command line.  If it can find a substring match, it will return
  3512. the index into the command line in which the first match occurs.
  3513. If no match can be found, it returns 0.  For example, if you run
  3514. the command TEST COMMAND.COM and call InCommandLine(".COM"), it
  3515. will return 1.
  3516.  
  3517. See Also: CommandLine, CommandLineValue.
  3518.  
  3519.  
  3520. InitPort                                                Comm
  3521. Declaration:   FUNCTION InitPort(PortIdx: Byte; BufferSize:
  3522.                Word);
  3523.  
  3524.      Initializes a port for use by the comm routines.  This must
  3525. be called before any other action is taken on a COM port.  Please
  3526. note that the PortIdx variable is not an index to the absolute
  3527. COM ports provided on the IBM and compatibles, but rather is an
  3528. index into the PortArray variable kept by the Comm unit.  Default
  3529. settings start things up so that COM1 is indexed as port 1, COM2
  3530. as port 2, COM3 as port 3, and COM4 as port 4.  Ports 5 through 8
  3531. are undefined in the default distribution and are intended for
  3532. use by non-standard ports or multiport hardware.
  3533.      BufferSize is the size of the send and receive buffers, in
  3534. bytes.  InitPort will return a True value if things went okay and
  3535. the port is initialized, and False if there was a problem such as
  3536. insufficient memory for the buffers or an index out of the range
  3537. 1..NumPorts.
  3538.  
  3539. See Also: DeInitPort.
  3540.  
  3541.  
  3542. InsertOn                                                Util
  3543. Declaration:   FUNCTION InsertOn: Boolean;
  3544.  
  3545.      Returns True if the keyboard is set up for insert mode, or
  3546. False if set up for overstrike mode.  This value is grabbed from
  3547. the BIOS data area, segment $40.
  3548.  
  3549. See Also:
  3550.  
  3551.  
  3552. IntToStr                                                Util
  3553. Declaration:   FUNCTION IntToStr(Num: Longint): String;
  3554.  
  3555.      Converts a numeric integer value into its string
  3556. representation.  This function performs the same task that the
  3557. Str system procedure does, but in a function form.
  3558.  
  3559. See Also: StrToInt.
  3560.  
  3561.  
  3562. Left                                                    Util
  3563. Declaration:   FUNCTION Left(Strn: String; Places: Byte):
  3564.                String;
  3565.  
  3566.      Left justifies a string of text to a length of Places bytes
  3567. by padding on the right side of the string.  If the string
  3568. exceeds the desired length, it is truncated on the right.
  3569.  
  3570. See Also: Center, Right.
  3571.  
  3572.  
  3573. LeftAltDown                                             Util
  3574. Declaration:   FUNCTION LeftAltDown: Boolean;
  3575.  
  3576.      Returns True if the left alt key is being held down.
  3577.  
  3578. See Also: AltDown, RightAltDown.
  3579.  
  3580.  
  3581. LeftControlDown                                         Util
  3582. Declaration:   FUNCTION LeftControlDown: Boolean;
  3583.  
  3584.      Returns True if the left control key is being held down.
  3585.  
  3586. See Also: ControlDown, RightControlDown.
  3587.  
  3588.  
  3589. LeftShiftDown                                           Util
  3590. Declaration:   FUNCTION LeftShiftDown: Boolean;
  3591.  
  3592.      Returns True if the left shift key is being held down.
  3593.  
  3594. See Also: RightShiftDown, ShiftDown.
  3595.  
  3596.  
  3597. LineRinging                                             Comm
  3598. Declaration:   FUNCTION LineRinging(PortIdx: Byte): Boolean;
  3599.  
  3600.      Returns the status of the ring indicator bit in the modem
  3601. status register.  Returns True if the bit is set, signaling that
  3602. the phone line is ringing.  False indicates that a ring is not
  3603. occurring now, but does not mean that there isn't a call to be
  3604. answered.
  3605.  
  3606. See Also: WaitForRingTrailer.
  3607.  
  3608.  
  3609. LoCase                                                  Util
  3610. Declaration:   FUNCTION LoCase(Ch: Char): Char;
  3611.  
  3612.      Converts all uppercase characters ('A'..'Z') to their
  3613. lowercase equivalent.
  3614.  
  3615. See Also: System.UpCase.
  3616.  
  3617.  
  3618. Lower                                                   Util
  3619. Declaration:   FUNCTION Lower(Strn: String): String;
  3620.  
  3621.      Converts all uppercase characters in a string to lowercase.
  3622. All other characters are unaffected.
  3623.  
  3624. See Also: Upper.
  3625.  
  3626.  
  3627. LowNybble                                               Util
  3628. Declaration:   FUNCTION LowNybble(A: Byte): Byte;
  3629.  
  3630.      Returns the lower 4 bits of a byte.  Example:
  3631. LowNybble($AB) returns $B.
  3632.  
  3633. See Also: HighNybble.
  3634.  
  3635.  
  3636. ModemError                                              Comm
  3637. Declaration:   FUNCTION ModemError(PortIdx: Byte): Byte;
  3638.  
  3639.      Returns the internal error flag byte kept for the COM port.
  3640. You can use the ErrXXX bit masks to extract information on error
  3641. conditions from this function.  Note that once the function is
  3642. called, the flags byte is reset to zero internally.  If you wish
  3643. to repeatedly test the returned byte, you will need to store it
  3644. in a new byte variable.
  3645.  
  3646. See Also: ErrXXX constants.
  3647.  
  3648.  
  3649. Moused variable                                        Mouse
  3650. Declaration:   Moused: Boolean;
  3651.  
  3652.      Initialized at program startup.  If a mouse is found, this
  3653. variable will be set to True.
  3654.  
  3655. See Also: MouseInstalled.
  3656.  
  3657.  
  3658. MouseInstalled                                         Mouse
  3659. Declaration:   FUNCTION MouseInstalled: Boolean;
  3660.  
  3661.      Checks to see if a mouse driver is installed at interrupt
  3662. $33.  If one is found, it will return True.
  3663.  
  3664. See Also: Moused variable.
  3665.  
  3666.  
  3667. MousePressed                                           Mouse
  3668. Declaration:   FUNCTION MousePressed(Button: Integer):
  3669.                Boolean;
  3670.  
  3671.      Returns the status of the specified mouse button being
  3672. depressed.  In general, a 0 is the left button, and a 1 is the
  3673. right button.
  3674.  
  3675. See Also: MouseReleased.
  3676.  
  3677.  
  3678. MouseReleased                                          Mouse
  3679. Declaration:   FUNCTION MouseReleased(Button: Integer):
  3680.                Boolean;
  3681.  
  3682.      Returns the status of the specified mouse button being
  3683. released.  In general, a 0 is the left button, and a 1 is the
  3684. right button.
  3685.  
  3686. See Also: MousePressed.
  3687.  
  3688.  
  3689. MoveMouse                                              Mouse
  3690. Declaration:   PROCEDURE MoveMouse(X, Y: Integer);
  3691.  
  3692.      Moves the mouse cursor to the (X,Y) on-screen.
  3693. Automatically does the conversion between graphics and text
  3694. modes, so this coordinate will be the same as the native mode
  3695. coordinate.
  3696.  
  3697. See Also: GetMouseAction.
  3698.  
  3699.  
  3700. MoveWord                                                Util
  3701. Declaration:   PROCEDURE MoveWord(Source, Dest: Pointer;
  3702.                Length: Word);
  3703.  
  3704.      Moves Length bytes from Source to Dest.  This procedure
  3705. moves information twice as fast as the system Move procedure
  3706. since it moves whole words at a time instead of bytes.  Length
  3707. should be an even number or the procedure will choke.
  3708.  
  3709. See Also: System.Move.
  3710.  
  3711.  
  3712. NumLock                                                 Util
  3713. Declaration:   FUNCTION NumLock: Boolean;
  3714.  
  3715.      Returns True if num lock is enabled.
  3716.  
  3717. See Also: CapsLock, ScrollLock.
  3718.  
  3719.  
  3720. NumPorts constant                                       Comm
  3721. Declaration:   NumPorts = 8;
  3722.  
  3723.      This constant controls the number of concurrent ports
  3724. supported by BBSkit.  If you change this number to anything
  3725. higher than 8, you must make sure to go into the code and create
  3726. interrupt services for the new ports.  This will entail editing
  3727. both COMM.PAS and BBSCOMM.ASM.  You may decrease this value
  3728. without affecting the operation of the Comm unit.
  3729.  
  3730. See Also: PortArray variable.
  3731.  
  3732.  
  3733. OCW constants                                           Comm
  3734. Declaration:   (in Const block)
  3735.  
  3736.      These constants are used to point at two ports in every IBM
  3737. compatible computer, the Operation Control Words.  These two
  3738. bytes control the 8259 Programmable Interrupt Chip and allow
  3739. BBSkit to receive comm interrupts from the comports in use.
  3740.  
  3741. OCW1 = $21     Operation control word 1; controls what
  3742.                interrupts are serviced.
  3743. OCW2 = $20     Operation control word 2; controls End Of
  3744.                Interrupt codes.
  3745.  
  3746. See Also: UART constants.
  3747.  
  3748.  
  3749. Parity                                                  Comm
  3750. Declaration:   FUNCTION Parity(PortIdx: Byte): TParity;
  3751.  
  3752.      Returns the parity set for the COM port.  It can be one of
  3753. NoParity, OddParity, EvenParity, MarkParity or SpaceParity.
  3754.  
  3755. See Also: SetParity, TParity type.
  3756.  
  3757.  
  3758. PeekKeyboard                                            Util
  3759. Declaration:   FUNCTION PeekKeyboard: Char;
  3760.  
  3761.      Peeks at the keyboard buffer and returns the next waiting
  3762. character, if any, without actually removing it from the buffer.
  3763.  
  3764. See Also:
  3765.  
  3766.  
  3767. PeekNextChar                                            Comm
  3768. Declaration:   FUNCTION PeekNextChar(PortIdx: Byte): Char;
  3769.  
  3770.      Returns the next available character in the receive buffer
  3771. without actually removing it from the buffer.  If there are no
  3772. characters waiting in the buffer, this function will return an
  3773. undefined character.
  3774.  
  3775. See Also: ReceiveBufferEmpty, Receive, ReceiveW.
  3776.  
  3777.  
  3778. PortArray variable                                      Comm
  3779. Declaration:   PortArray : Array[1..NumPorts] of TPortCfg;
  3780.  
  3781.      Defines an array which holds all of the information on the
  3782. COM ports usable by the communications routines.
  3783.  
  3784. See Also: NumPorts constant.
  3785.  
  3786.  
  3787. Processor                                               Util
  3788. Declaration:   FUNCTION Processor: Integer;
  3789.  
  3790.      Returns the processor type determined by running a couple of
  3791. checks.  The value returned will be one of the following and
  3792. corresponds to a different member of the 80x86 family:
  3793.  
  3794.           0 = Intel 8088  (or compatible chip)
  3795.           1 = Intel 8086  (or compatible chip)
  3796.           2 = Intel 80286  (or compatible chip)
  3797.           3 = Intel 80386  (or compatible chip)
  3798.           4 = Intel 80486+  (or compatible chip)
  3799.           
  3800. See Also: System.Test8086 variable (BP7+).
  3801.  
  3802.  
  3803. ProgramName                                             Util
  3804. Declaration:   FUNCTION ProgramName: NameStr;
  3805.  
  3806.      Returns the name of the program running.  This is fetched
  3807. from the command line (the program name is in ParamStr(0)).
  3808.  
  3809. See Also: GetFilename.
  3810.  
  3811.  
  3812. PutScreenWord                                           Util
  3813. Declaration:   PROCEDURE PutScreenWord(X, Y: Byte; Ch: Char;
  3814.                Attr: Byte);
  3815.  
  3816.      Puts a character and attribute combination directly into the
  3817. console's video memory at the character cell defined by (X,Y).
  3818. This coordinate is absolute and is not affected by any active
  3819. windows.
  3820.  
  3821. See Also: GetScreenWord, PutText.
  3822.  
  3823.  
  3824. PutText                                                 Util
  3825. Declaration:   PROCEDURE PutText(X, Y: Byte; Source:
  3826.                Pointer);
  3827.  
  3828.      Puts a block of text previously saved with a call to GetText
  3829. directly into the console's video memory.  The upper left corner
  3830. of the block is defined by (X,Y).  This coordinate is absolute
  3831. and is not affected by any active windows.
  3832.  
  3833. See Also: GetText, PutScreenWord.
  3834.  
  3835.  
  3836. Receive                                                 Comm
  3837. Declaration:   FUNCTION Receive(PortIdx: Byte): Char;
  3838.  
  3839.      Returns the next character from the receive buffer.  If
  3840. there are no character waiting in the buffer, it will not wait
  3841. but will rather return an undefined character.
  3842.  
  3843. See Also: PeekNextChar, ReceiveW.
  3844.  
  3845.  
  3846. ReceiveBlock                                            Comm
  3847. Declaration:   PROCEDURE ReceiveBlock(PortIdx: Byte; Block:
  3848.                Pointer; Len: Word);
  3849.  
  3850.      Receives a block of characters of length Len from the COM
  3851. port.  This is much more efficient than repeatedly calling
  3852. ReceiveW if you are expecting large blocks of data.
  3853.      ReceiveBlock will wait patiently for enough characters to
  3854. appear before it returns.
  3855.  
  3856. See Also: ReceiveW, SendBlock.
  3857.  
  3858.  
  3859. ReceiveBufferEmpty                                      Comm
  3860. Declaration:   FUNCTION ReceiveBufferEmpty(PortIdx: Byte):
  3861.                Boolean;
  3862.  
  3863.      Returns True if there are no characters waiting in the
  3864. receive buffer, False otherwise.  Use this function to check and
  3865. see if there are any waiting characters before calling
  3866. PeekNextChar or Receive to avoid getting garbage characters.
  3867.  
  3868. See Also: ReceiveBufferFull.
  3869.  
  3870.  
  3871. ReceiveBufferFull                                       Comm
  3872. Declaration:   FUNCTION ReceiveBufferFull(PortIdx: Byte):
  3873.                Boolean;
  3874.  
  3875.      Returns True if there is no room remaining in the receive
  3876. buffer, False otherwise.  If this function returns True and
  3877. another characters needs to be put in the buffer before any are
  3878. removed, an overflow error will result on the receive buffer.
  3879.  
  3880. See Also: ReceiveBufferEmpty.
  3881.  
  3882.  
  3883. ReceiveW                                                Comm
  3884. Declaration:   FUNCTION ReceiveW(PortIdx: Byte): Char;
  3885.  
  3886.      Waits for a character to appear in the receive buffer before
  3887. fetching and returning it.  This is the function which will be
  3888. most used in your applications since it will never return garbage
  3889. characters.  To avoid getting stuck in a loop you should still
  3890. call ReceiveBufferEmpty before calling this function, however.
  3891.  
  3892. See Also: Receive, ReceiveBufferEmpty.
  3893.  
  3894.  
  3895. Replicate                                               Util
  3896. Declaration:   FUNCTION Replicate(Ch: String; Num: Byte):
  3897.                String;
  3898.  
  3899.      Repeats a string of characters Num times and returns the
  3900. resulting string.  It is up to the programmer to make sure that
  3901. the resulting string does not exceed 255 characters.
  3902.  
  3903. See Also: Space.
  3904.  
  3905.  
  3906. RestoreScreen                                           Util
  3907. Declaration:   PROCEDURE RestoreScreen;
  3908.  
  3909.      Restores the screen to a previous state after a call to
  3910. SaveScreen.  You can use these procedures in combination to
  3911. restore the screen after running a program.  Put a call to
  3912. SaveScreen at the beginning of your program before you send any
  3913. output to the screen, and call RestoreScreen right before you
  3914. exit to DOS to restore the user's screen before quitting.
  3915. Restoring a screen not previously saved will give unpredictable
  3916. results.
  3917.  
  3918. See Also: SaveScreen.
  3919.  
  3920.  
  3921. Right                                                   Util
  3922. Declaration:   FUNCTION Right(Strn: String; Places: Byte):
  3923.                String;
  3924.  
  3925.      Right justifies a string by padding the left edge with
  3926. spaces until the length of the string is equal to Places.  If the
  3927. string was too long to begin with, it will be truncated on the
  3928. left edge.
  3929.  
  3930. See Also: Center, Left.
  3931.  
  3932.  
  3933. RightAltDown                                            Util
  3934. Declaration:   FUNCTION RightAltDown: Boolean;
  3935.  
  3936.      Returns True if the right alt key is being held down.
  3937.  
  3938. See Also: AltDown, LeftAltDown.
  3939.  
  3940.  
  3941. RightControlDown                                        Util
  3942. Declaration:   FUNCTION RightControlDown: Boolean;
  3943.  
  3944.      Returns True if the right control key is being held down.
  3945.  
  3946. See Also: ControlDown, LeftControlDown.
  3947.  
  3948.  
  3949. RightShiftDown                                          Util
  3950. Declaration:   FUNCTION RightShiftDown: Boolean;
  3951.  
  3952.      Returns True if the right shift key is being held down.
  3953.  
  3954. See Also: LeftShiftDown, ShiftDown.
  3955.  
  3956.  
  3957. RootDir                                                 Util
  3958. Declaration:   FUNCTION RootDir: DirStr;
  3959.  
  3960.      Returns the root directory from which the program was run.
  3961. This can be especially useful for storing files in one standard
  3962. directory on disk.  The pathname will always end in a backslash
  3963. (\).
  3964.  
  3965. See Also: GetPathname.
  3966.  
  3967.  
  3968. SaveScreen                                              Util
  3969. Declaration:   PROCEDURE SaveScreen;
  3970.  
  3971.      Saves the screen and cursor position for later restoration
  3972. using RestoreScreen.  If you call this procedure more than once,
  3973. only the most recent save will be kept.
  3974.  
  3975. See Also: RestoreScreen.
  3976.  
  3977.  
  3978. ScrollLock                                              Util
  3979. Declaration:   FUNCTION ScrollLock: Boolean;
  3980.  
  3981.      Returns True if scroll lock is enabled.
  3982.  
  3983. See Also: CapsLock, NumLock.
  3984.  
  3985.  
  3986. Segment constants                                       Util
  3987. Declaration:   Const
  3988.                  Seg0040 : Word = $40;
  3989.                  SegA000 : Word = $A000;
  3990.                  SegB000 : Word = $B000;
  3991.                  SegB800 : Word = $B800;
  3992.  
  3993.      These constants are deleted to keep the source compatible
  3994. with Turbo Pascal 6.0.  When compiling under 7.0, this block is
  3995. not included since the constants are already defined.  They are
  3996. provided for compatibility with programs compiled for DPMI.  You
  3997. should make it a habit to use these segment constants instead of
  3998. the literal values since under DPMI their values may change.
  3999.  
  4000. See Also:
  4001.  
  4002.  
  4003. Send                                                    Comm
  4004. Declaration:   PROCEDURE Send(PortIdx: Byte; Ch: Char);
  4005.  
  4006.      Sends a single character out the COM port by placing it in
  4007. the send buffer.  If there is not enough room in the buffer for
  4008. this character, the overflow bit will be set in the error flag
  4009. and the character will not be sent.  If you wish to use some
  4010. error checking and not lose characters, you should probably use
  4011. SendW.
  4012.  
  4013. See Also: SendBlock, SendW.
  4014.  
  4015.  
  4016. SendBlock                                               Comm
  4017. Declaration:   PROCEDURE SendBlock(PortIdx: Byte; Block:
  4018.  
  4019.                Pointer; Len: Word);
  4020.  
  4021.      Sends a block of data out the COM port by placing it in the
  4022. send buffer in one quick move instead of repeatedly calling
  4023. SendW.  This is much more efficient.
  4024.      SendBlock will patiently wait for enough room to be in the
  4025. buffer before starting the move.
  4026.  
  4027. See Also: Send, SendW.
  4028.  
  4029.  
  4030. SendBreak                                               Comm
  4031. Declaration:   PROCEDURE SendBreak(PortIdx: Byte);
  4032.  
  4033.      Sends a 230ms break signal across the line.  Some systems
  4034. (including these comm routines) are smart enough to give a break
  4035. signal special handling.
  4036.  
  4037. See Also: ErrXXX constants, ModemError.
  4038.  
  4039.  
  4040. SendBufferEmpty                                         Comm
  4041. Declaration:   FUNCTION SendBufferEmpty(PortIdx: Byte):
  4042.                Boolean;
  4043.  
  4044.      Returns True if the send buffer for the COM port is empty.
  4045. Otherwise it returns False.
  4046.  
  4047. See Also: SendBufferFull.
  4048.  
  4049.  
  4050. SendBufferFull                                          Comm
  4051. Declaration:   FUNCTION SendBufferFull(PortIdx: Byte):
  4052.                Boolean;
  4053.  
  4054.      Returns True if the send buffer is completely filled and
  4055. there is no room for any additional characters, False otherwise.
  4056.  
  4057. See Also: SendBufferEmpty.
  4058.  
  4059.  
  4060. SendString                                              Comm
  4061. Declaration:   PROCEDURE SendString(PortIdx: Byte; Strn:
  4062.                String);
  4063.  
  4064.      Sends an entire string out the COM port by placing the
  4065. characters in the send buffer.  This procedure does pay attention
  4066. to the buffer size and will wait for room if there isn't enough
  4067. at first.  Actually equivalent to calling SendBlock(PortIdx,
  4068. @Strn[1], Length(Strn)).
  4069.  
  4070. See Also: SendBlock.
  4071.  
  4072.  
  4073. SendW                                                   Comm
  4074. Declaration:   PROCEDURE SendW(PortIdx: Byte; Ch: Char);
  4075.  
  4076.      Places a character in the send buffer, after first making
  4077. sure there is room.  If there isn't, it will wait until there and
  4078. then place the character.
  4079.  
  4080. See Also: Send, SendBlock.
  4081.  
  4082.  
  4083. SetBBSMode                                              Comm
  4084. Declaration:   PROCEDURE SetBBSMode(PortIdx: Byte; Status:
  4085.                Boolean);
  4086.  
  4087.      Either enables or disables the BBS mode depending on the
  4088. argument passed in Status.  When True, the comm routines will pay
  4089. attention to user inactivity during handshaking and will allow
  4090. the remote user to clear the receive buffer using either a break
  4091. signal or a special control character.
  4092.      When disabled, the comm routines won't watch user
  4093. inactivity, and won't translate break signals or a clear
  4094. character.
  4095.  
  4096. See Also: ErrXXX constants, ModemError.
  4097.  
  4098.  
  4099. SetBit                                                  Util
  4100. Declaration:   PROCEDURE SetBit(var Value: Byte; Bit: Byte);
  4101.  
  4102.      Sets a bit in the Value byte.  Bit must be a value between 0
  4103. and 7, inclusive.  A 0 corresponds to the least significant bit,
  4104. while 7 to the most significant.
  4105.  
  4106. See Also: BitIsSet, ClearBit.
  4107.  
  4108.  
  4109. SetBpsRate                                              Comm
  4110. Declaration:   PROCEDURE SetBpsRate(PortIdx: Byte; Bps:
  4111.                Longint);
  4112.  
  4113.      Sets the bits per second (bps) rate of the COM port.  It
  4114. does this by computing a divisor value based on the bps rate
  4115. which will fit into a 16-bit value, and placing the two bytes in
  4116. the UART registers.
  4117.  
  4118. See Also: BpsRate.
  4119.  
  4120.  
  4121. SetBreakClearBuffer                                     Comm
  4122. Declaration:   PROCEDURE SetBreakClearBuffer(PortIdx: Byte;
  4123.  
  4124.                Status; Boolean);
  4125.  
  4126.      When BBS mode is turned on with a call to SetBBSMode, a
  4127. break signal sent by the remote user is capable of clearing the
  4128. receive buffer on the local machine.  This procedure sets whether
  4129. or not you want the break signal to clear the buffer or to set a
  4130. bit in the ErrorFlg variable to be handled by your own code.
  4131. Clearing the receive buffer can be useful for users when they
  4132. have sent a command that they no longer want processed by the
  4133. system.
  4134.  
  4135. See Also: SetBBSMode, SetClearBufferChar.
  4136.  
  4137.  
  4138. SetClearBufferChar                                      Comm
  4139. Declaration:   PROCEDURE SetClearBufferChar(PortIdx: Byte;
  4140.                Ch: Char);
  4141.  
  4142.      When BBS mode is enabled, the internal routines are capable
  4143. of clearing the local receive buffer when a predefined character
  4144. is received.  Typically this character is a non-displayable
  4145. control character, and is defined with this procedure.  When the
  4146. remote user sends this character, the receive buffer will be
  4147. emptied before it can be processed.  This can be useful for
  4148. clearing a command which has already been sent in error.
  4149.  
  4150. See Also: SetBreakClearBuffer.
  4151.  
  4152.  
  4153. SetDTR                                                  Comm
  4154. Declaration:   PROCEDURE SetDTR(PortIdx: Byte; Status:
  4155.                Boolean);
  4156.  
  4157.      Sets the Data Terminal Ready bit in the modem control
  4158. register.  Most modems will not accept commands or send & receive
  4159. data until the DTR bit is set high (True).  Additionally, a low
  4160. DTR bit will often signal a modem to hang up the phone and break
  4161. any existing connection.  Generally, you'll want to set this to
  4162. True before doing any I/O work with your COM port.
  4163.  
  4164. See Also: DataTerminalReady.
  4165.  
  4166.  
  4167. SetFIFO                                                 Comm
  4168. Declaration:   PROCEDURE SetFIFO(PortIdx: Byte; Status:
  4169.                Boolean);
  4170.  
  4171.      This procedure controls the use of the FIFO (first-in, first-
  4172. out) buffers found on the National 16550A UART.  The FIFO buffers
  4173. are useful for high-speed connections because they can buffer
  4174. data if the CPU is not fast enough to process it as it comes in.
  4175. This procedure simply enables or disables the FIFOs.  If you want
  4176. to specify the depth of the FIFO buffers (1, 4, 8 or 14
  4177. characters) you can do that using the SetFIFOTrigger procedure.
  4178.  
  4179. See Also: SetFIFOTrigger.
  4180.  
  4181.  
  4182. SetFIFOTrigger                                          Comm
  4183. Declaration:   PROCEDURE SetFIFOTrigger(PortIdx, Trigger:
  4184.                Byte);
  4185.  
  4186.      Sets the trigger level of the internal FIFO buffers on the
  4187. National 16550A UART.  The trigger level specifies how many
  4188. characters must be in the buffer before the appropriate interrupt
  4189. is triggered.  The value can be one of 1, 4, 8 or 14 characters.
  4190.      The interrupt will also be triggered if no additional
  4191. activity takes place in the time it takes to receive a character,
  4192. in the case of the receive interrupt.
  4193.  
  4194. See Also: SetFIFO.
  4195.  
  4196.  
  4197. SetFlowControl                                          Comm
  4198. Declaration:   PROCEDURE SetFlowControl(PortIdx: Byte;
  4199.                XonXoff, RTSCTS: Boolean);
  4200.  
  4201.      Sets the flow control styles used by the comm routines.
  4202. Usually this will be one or the other, and generally not both.
  4203. If True, that style of flow control is enabled.  If False, it is
  4204. disabled.
  4205.      XonXoff corresponds to software flow control, which makes
  4206. use of two characters from the available character set for flow
  4207. control.  RTSCTS corresponds to hardware flow control, which uses
  4208. hardware lines for flow control, remaining transparent to the
  4209. character set.
  4210.  
  4211. See Also: GetFlowControl, SetFlowLimits.
  4212.  
  4213.  
  4214. SetFlowLimits                                           Comm
  4215. Declaration:   PROCEDURE SetFlowLimits(PortIdx: Byte; Xon,
  4216.                Xoff: Word);
  4217.  
  4218.      Controls the level of the buffers as flow control is enabled
  4219. and disabled.  Xon and Xoff correspond to the number of
  4220. characters left in the buffer as each action occurs.
  4221.      When the level rises to Xon or higher, flow control is
  4222. enabled.  Generally this should be about 8 or so characters less
  4223. than the size of your buffers.  Flow control is disabled when the
  4224. level drops equal to or below Xoff.
  4225.  
  4226. See Also: SetFlowControl.
  4227.  
  4228.  
  4229. SetInactiveLimit                                        Comm
  4230. Declaration:   PROCEDURE SetInactiveLimit(PortIdx: Byte;
  4231.                Sec: Word);
  4232.  
  4233.      Sets the time, in seconds, that a user can leave flow
  4234. control enabled without releasing it.  This is only watched when
  4235. in BBS mode, enabled through a call to SetBBSMode.  It is
  4236. designed to keep users from tying up your system by enabled flow
  4237. control and walking away for excessive periods of time.
  4238.  
  4239. See Also: SetBBSMode.
  4240.  
  4241.  
  4242. SetMouseCursorStyle                                    Mouse
  4243. Declaration:   PROCEDURE SetMouseCursorStyle(OrdChar:
  4244.                Integer);
  4245.  
  4246.      Defines how the cursor looks in text mode.  This procedure
  4247. just changes the look of the mouse cursor and the affect it has
  4248. on the colors of the screen.  The high byte is the color mask,
  4249. and the low byte is the ASCII code of the character in the
  4250. foreground.
  4251.  
  4252. See Also:
  4253.  
  4254.  
  4255. SetParity                                               Comm
  4256. Declaration:   PROCEDURE SetParity(PortIdx: Byte; Mode:
  4257.                TParity);
  4258.  
  4259.      Sets the parity style used for the COM port.  The five
  4260. parity styles can be found by looking under TParity.  Generally,
  4261. NoParity is used for 8-bit connections, while EvenParity is used
  4262. for many 7-bit connections.
  4263.  
  4264. See Also: Parity, TParity type.
  4265.  
  4266.  
  4267. SetRTS                                                  Comm
  4268. Declaration:   PROCEDURE SetRTS(PortIdx: Byte; Status:
  4269.                Boolean);
  4270.  
  4271.      Sets the request to send bit in the modem control register.
  4272. This bit is used for hardware flow control and generally
  4273. shouldn't be touched except by the internal comm routines.
  4274.  
  4275. See Also: ClearToSend.
  4276.  
  4277.  
  4278. SetSoftHandshake                                        Comm
  4279. Declaration:   PROCEDURE SetSoftHandshake(PortIdx: Byte;
  4280.                Xon, Xoff: Char);
  4281.  
  4282.      Sets the characters used in software handshaking for start
  4283. and stop of transmission.  Xon is the character used for
  4284. restarting the transmission, while Xoff is the character used for
  4285. stopping transmission.  Traditionally, these values of been ^S to
  4286. stop, and ^Q to restart.
  4287.  
  4288. See Also: SetFlowControl.
  4289.  
  4290.  
  4291. SetStopBits                                             Comm
  4292. Declaration:   PROCEDURE SetStopBits(PortIdx: Byte; Bits:
  4293.                TStopBits);
  4294.  
  4295.      Controls the number of stop bits used by the UART for
  4296. sending & receiving characters.  Typically, this value is 1 for
  4297. either 7- or 8-bit connections.  Legal values are either 1 or 2.
  4298. Note that when the word length is set to 5, setting stop bits to
  4299. 2 actually sends only 1.5.
  4300.  
  4301. See Also: StopBits, TStopBits type.
  4302.  
  4303.  
  4304. SetWordLength                                           Comm
  4305. Declaration:   PROCEDURE SetWordLength(PortIdx: Byte;
  4306.                WordLen: TWordLength);
  4307.  
  4308.      Sets the word length of characters sent & received by the
  4309. UART.  Values for this can range from 5 to 8.  Typically, this
  4310. will be either 7 or 8.
  4311.  
  4312. See Also: TWordLength type, WordLength.
  4313.  
  4314.  
  4315. ShiftDown                                               Util
  4316. Declaration:   FUNCTION ShiftDown: Boolean;
  4317.  
  4318.      Returns True if either shift key is being held down.
  4319.  
  4320. See Also: LeftShiftDown, RightShiftDown.
  4321.  
  4322.  
  4323. ShowMouseCursor                                        Mouse
  4324. Declaration:   PROCEDURE ShowMouseCursor;
  4325.  
  4326.      Shows the mouse cursor if it isn't already visible.
  4327.  
  4328. See Also: HideMouseCursor.
  4329.  
  4330.  
  4331. ShowTextCursor                                          Util
  4332. Declaration:   PROCEDURE ShowTextCursor;
  4333.  
  4334.      Makes the text mode cursor visible by resetting it back to
  4335. the video card defaults (a two scanline cursor in the bottom of
  4336. the cell).
  4337.  
  4338. See Also: HideTextCursor.
  4339.  
  4340.  
  4341. SizeCursor                                              Util
  4342. Declaration:   PROCEDURE SizeCursor(Top, Bottom: Byte);
  4343.  
  4344.      Defines the beginning and ending scanlines for the text mode
  4345. cursor.  A solid block cursor would be equivalent to
  4346. SizeCursor(0, 14) on EGA/VGA cards.
  4347.  
  4348. See Also: HideTextCursor, ShowTextCursor.
  4349.  
  4350.  
  4351. Space                                                   Util
  4352. Declaration:   FUNCTION Space(Num: Byte): String;
  4353.  
  4354.      Returns Num spaces in a string.
  4355.  
  4356. See Also: Replicate.
  4357.  
  4358.  
  4359. StopBits                                                Comm
  4360. Declaration:   FUNCTION StopBits(PortIdx: Byte): TStopBits;
  4361.  
  4362.      Returns the number of stop bits in use on the COM port.
  4363. This value will either be 1 or 2.
  4364.  
  4365. See Also: SetStopBits, TStopBits type.
  4366.  
  4367.  
  4368. StrobeKeyboard                                          Util
  4369. Declaration:   PROCEDURE StrobeKeyboard;
  4370.  
  4371.      Removes all waiting keypresses from the keyboard buffer and
  4372. exits.
  4373.  
  4374. See Also:
  4375.  
  4376.  
  4377. StrToInt                                                Util
  4378. Declaration:   FUNCTION StrToInt(Strn: String): Longint;
  4379.  
  4380.      Converts a string into its integer representation and
  4381. returns the result.  StrToInt stops converting when it hits an
  4382. illegal character in the string, so the string "123HELLO" will
  4383. still return 123 as an answer.  If the string cannot be converted
  4384. (example "HELLO") then it will return 0.
  4385.  
  4386. See Also: IntToStr.
  4387.  
  4388.  
  4389. SwapB                                                   Util
  4390. Declaration:   PROCEDURE SwapB(var A: Byte);
  4391.  
  4392.      Swaps the high and low nybbles in the byte.  $AB comes back
  4393. as $BA.
  4394.  
  4395. See Also: System.Swap.
  4396.  
  4397.  
  4398. TCountryInfo record                                     Util
  4399. Declaration:   TCountryInfo = record
  4400.                  DateFmt    : Word;
  4401.                  CurrencySym: Array[1..5] of Char;
  4402.                  ThousandSep: Char;
  4403.                  Res1       : Byte;
  4404.                  DecimalSep : Char;
  4405.                  Res2       : Byte;
  4406.                  DateSep    : Char;
  4407.                  Res3       : Byte;
  4408.                  TimeSep    : Char;
  4409.                  Res4       : Byte;
  4410.                  CurrencyFmt: Byte;
  4411.                  DigAfterDec: Byte;
  4412.                  TimeFmt    : Byte;
  4413.                  CaseMap    : Pointer;
  4414.                  DataListSep: Char;
  4415.                  Res5       : Byte;
  4416.                  Res6       : Array[1..10] of Byte;
  4417.                end;
  4418.  
  4419.      This record is used by GetCountryInfo procedure.  Your
  4420. programs can then take advantage of the country info as specified
  4421. by DOS.  The Util unit already handles this sort of thing in the
  4422. Date and Time functions.  ResX variables are bytes reserved by
  4423. DOS and having no known useful purpose.
  4424.  
  4425. See Also: GetCountryInfo.
  4426.  
  4427.  
  4428. TCountdownTimer object                                  Util
  4429. Declaration:   TCountdownTimer = object
  4430.                  TimeLeft: TTime;
  4431.                  SecLeft : Longint;
  4432.                  Timer   : TTimer;
  4433.  
  4434.                  PROCEDURE ClearCountdown;
  4435.                  FUNCTION GetSecondsLeft: Longint;
  4436.                  PROCEDURE GetTimeLeft(var TimeRec: TTime);
  4437.                  PROCEDURE SetTimeLeft(TimeRec: TTime);
  4438.                  PROCEDURE StartCountdown;
  4439.  
  4440.                  PROCEDURE StopCountdown;
  4441.                end;
  4442.  
  4443.      This object provides a countdown timer, which will start a
  4444. certain value, and count down as time passes.  It is up to the
  4445. programmer to check this object often enough to catch it when it
  4446. hits zero seconds remaining.
  4447.      The methods are explained in more detail below.
  4448.  
  4449. ClearCountdown Clears the countdown timer and stops it if it was
  4450.                running.
  4451. GetSecondsLeft Returns the number of seconds left in the
  4452.                countdown.  This value will never drop below zero.
  4453. GetTimeLeft    Returns the exact amount of time left in a TTime
  4454.                record, which provides a bit more precision that
  4455.                GetSecondsLeft.
  4456. SetTimeLeft    Sets the time that the countdown will start at.
  4457.                Unless the timer is already running, you will need
  4458.                to call StartCountdown to begin timing.
  4459. StartCountdown Starts the countdown timer.
  4460. StopCountdown  Stops the countdown timer.
  4461.                
  4462. See Also: TTime record, TTimer.
  4463.  
  4464.  
  4465. Test8086                                                Util
  4466. Declaration:   Test8086: Byte;
  4467.  
  4468.      Note: this variable is defined in the System unit for Turbo
  4469. Pascal 7.0+.  This variable is almost exactly like the CPU
  4470. variable defined for all versions of TP, but slightly different
  4471. in order to match the value returned in the Test8086 variable in
  4472. Turbo Pascal 7.0+.  It's value corresponds to the following for
  4473. processor types:
  4474.  
  4475.           0 = Intel 8088/8086 (or compatible)
  4476.           1 = Intel 80286 (or compatible)
  4477.           2 = Intel 80386 (or compatible)
  4478.           3 = Intel 80486+ (or compatible)
  4479.           
  4480. See Also:
  4481.  
  4482.  
  4483. TextMemSize                                             Util
  4484. Declaration:   FUNCTION TextMemSize(X1, Y1, X2, Y2: Byte):
  4485.                Word;
  4486.  
  4487.      Returns the number of bytes needed to store a text block in
  4488. memory using GetText.  This function returns a value based on
  4489. this formula:
  4490.  
  4491.               [(X2 - X1) + 1] * [(Y2 - Y1) + 1] + 2
  4492.                                 
  4493. See Also: GetText.
  4494.  
  4495.  
  4496. TextScreenMaxX                                          Util
  4497. Declaration:   FUNCTION TextScreenMaxX: Byte;
  4498.  
  4499.      Returns the width of the text screen, ignoring any active
  4500. windows.  Usually this value will come back as 80.
  4501.  
  4502. See Also: TextScreenMaxY, TextWinMaxX.
  4503.  
  4504.  
  4505. TextScreenMaxY                                          Util
  4506. Declaration:   FUNCTION TextScreenMaxY: Byte;
  4507.  
  4508.      Returns the height of the text screen, ignoring any active
  4509. windows.
  4510.  
  4511. See Also: TextScreenMaxX, TextWinMaxY.
  4512.  
  4513.  
  4514. TextWinMaxX                                             Util
  4515. Declaration:   FUNCTION TextWinMaxX: Byte;
  4516.  
  4517.      Returns the width of the current window defined on-screen.
  4518.  
  4519. See Also: TextScreenMaxX, TextWinMaxY.
  4520.  
  4521.  
  4522. TextWinMaxY                                             Util
  4523. Declaration:   FUNCTION TextWinMaxY: Byte;
  4524.  
  4525.      Returns the height of the current window defined on-screen.
  4526.  
  4527. See Also: TextScreenMaxY, TextWinMaxX.
  4528.  
  4529.  
  4530. TFarProc type                                           Util
  4531. Declaration:   TFarProc = PROCEDURE;
  4532.  
  4533.      Defines a type that represents a procedure.  This is used to
  4534. pass procedures as parameters to other procedures or functions.
  4535.  
  4536. See Also:
  4537.  
  4538.  
  4539. Time                                                    Util
  4540. Declaration:   FUNCTION Time: String;
  4541.  
  4542.      Returns the current system time in a format which follows
  4543. the information retrieved from DOS about the local country
  4544. formats.  Time is returned in 12-hour format, with a trailing 'a'
  4545. or 'p' to specify AM or PM.
  4546.  
  4547. See Also: Date.
  4548.  
  4549.  
  4550. TParity type                                            Comm
  4551. Declaration:   TParity = (NoParity, OddParity, EvenParity,
  4552.                MarkParity, SpaceParity);
  4553.  
  4554.      Enumerated type used in the SetParity procedure.  The five
  4555. values equate to the five different parity checking schemes used
  4556. by 8250B compatible UARTs.
  4557.  
  4558. NoParity       No parity checking done.  This is used for 8-
  4559.                bit data words.
  4560. OddParity      Parity set to make the number of 1's in the
  4561.                word odd.
  4562. EvenParity     Parity set to make the number of 1's in the
  4563.                word even.
  4564. MarkParity     Parity always a 1.
  4565. SpaceParity    Parity always a 0.
  4566.  
  4567.      Parity is a fairly weak form of error detection used in 7-
  4568. bit connections.  The parity bit is always the 8th bit of a word,
  4569. and both ends of the connection must be set to the same parity
  4570. for it to work at all.  When a parity check fails, the UART will
  4571. set the parity error bit in the line status register.  You can
  4572. check for parity errors using the ModemError function and the
  4573. ErrParity mask.
  4574.  
  4575. See Also: ErrXXX constants, ModemError, SetParity.
  4576.  
  4577.  
  4578. TPortCfg record                                         Comm
  4579. Declaration:   TPortCfg = record
  4580.  
  4581.      The complete record contains the following fields:
  4582.  
  4583. Initialized    Boolean; True if the port is initialized.
  4584. Comport        Byte value of the COM port being used (1 =
  4585.                COM1).
  4586. PortAddr       Word value of the base address of this COM
  4587.                port.
  4588. IntVector      Byte value pointing to the interrupt vector
  4589.                to use.
  4590. InBuffer       Pointer to the receive buffer.
  4591. OutBuffer      Pointer to the send buffer.
  4592. NewHandler     Pointer to the handler used when this COM
  4593.                port is active.
  4594. OldHandler     Pointer to the old handler when this COM port
  4595.                is active.
  4596. BuffSize       Word value of the size of the input and
  4597.                output buffers.
  4598. InHead         Word value pointing to the first character in
  4599.                the buffer.
  4600. InTail         Word value pointing to the last character in
  4601.                the buffer.
  4602. InUsed         Word value giving the number of characters in
  4603.                the buffer.
  4604. OutHead        Word value pointing to the first character to
  4605.                be sent.
  4606. OutTail        Word value pointing to the last character to
  4607.                be sent.
  4608. OutUsed        Word value giving the number of characters in
  4609.                the buffer.
  4610. HndShkOn       Word value signaling when auto handshaking
  4611.                should start (if enabled).
  4612. HndShkOff      Word value signaling when auto handshaking
  4613.                should end (if enabled).
  4614. TimeCount      Internal counter for user inactivity.
  4615. StartCh        Character sent to restart incoming characters
  4616.                (soft handshaking).
  4617. StopCh         Character sent to stop incoming characters
  4618.                (soft handshaking).
  4619. StatusFlg      Byte sized bit flags status variable.
  4620. ErrorFlg       Byte sized bit flags error variable.
  4621. ClearCh        Character used to clear the receive buffer.
  4622. FIFOs          Depth of the FIFO buffers, 0 if disabled.
  4623.  
  4624.      These variables are handled inside the internal comm
  4625. routines, and it is probably a bad idea to change them unless you
  4626. really know what you are doing.
  4627.  
  4628. See Also:
  4629.  
  4630.  
  4631. TRecordCollection object                                Util
  4632. Declaration:   TRecordCollection = object(TCollection)
  4633.                  PROCEDURE FreeItem(Item: Pointer); virtual;
  4634.                end;
  4635.  
  4636.      The stock TCollection object that comes with the Objects
  4637. unit in Turbo Pascal 6.0 or later is meant for use as a
  4638. collection of objects.  In other words, it calls Dispose with a
  4639. destructor which records do not have.  TRecordCollection
  4640. overrides the FreeItem method to simply call Dispose with no
  4641. destructor.
  4642.  
  4643. See Also: TCollection.
  4644.  
  4645.  
  4646. TStopBits type                                          Comm
  4647. Declaration:   TStopBits = 1..2;
  4648.  
  4649.      Defines how many stop bits (either 1 or 2) will be used by
  4650. the UART to signal the end of a character.  Set this through the
  4651. SetStopBits procedure.
  4652.  
  4653. See Also: SetStopBits.
  4654.  
  4655.  
  4656. TTime record                                            Util
  4657. Declaration:   TTime = record
  4658.                  Hour, Min, Sec, HSec: Word;
  4659.                end;
  4660.  
  4661.      Record used for the TTimer and TCountdownTimer objects.
  4662. Holds values for the hour, minute, second and hundredth of a
  4663. second.
  4664.  
  4665. See Also: TTimer, TCountdownTimer.
  4666.  
  4667.  
  4668. TTimer object                                           Util
  4669. Declaration:   TTimer = object
  4670.                  Start, Stop: TTime;
  4671.                  ElaspedTot : TTime;
  4672.                  Stopped    : Boolean;
  4673.  
  4674.                  PROCEDURE ClearTimer;
  4675.                  FUNCTION ElapsedSeconds: Longint;
  4676.                  PROCEDURE ElapsedTime(var Elapse: TTime);
  4677.                  PROCEDURE GetStartTime(var TimeRec: TTime);
  4678.                  PROCEDURE GetStopTime(var TimeRec: TTime);
  4679.                  PROCEDURE ResetTimer;
  4680.                  PROCEDURE StartTimer;
  4681.                  PROCEDURE StopTimer;
  4682.                end;
  4683.  
  4684.      This object acts as a kind of stopwatch.  You can start and
  4685. stop the timer as many times as you wish without losing the "lap
  4686. time" being kept internally.  If you run the timer for 5 seconds,
  4687. stop it for 10, and run it for an additional 5 seconds,
  4688. ElapsedSeconds will return a total of 10 seconds of elapsed time.
  4689.      Note: you must call ClearTimer before you start the timer
  4690. for the first time to ensure the proper values are set in the
  4691. object.  Otherwise you will get wrong results, infinite loops, or
  4692. arithmetic overflows (BP7 only).  Each method is explained in
  4693. more detail below.
  4694.  
  4695. ClearTimer     Clears the timer and initializes it for use.  This
  4696.                must be called before the timer is started for the
  4697.                first time.  It can also be used during timing to
  4698.                stop the timer, and clear all internal values to
  4699.                zero.
  4700. ElapsedSeconds Returns the elapsed time in seconds.  The timer is
  4701.                cumulative; if you start the timer and let it run,
  4702.                stop it, and start it again later, the time will
  4703.                accumulate instead of start back at zero.
  4704. ElapsedTime    Returns the elapsed time as a TTime record.  This
  4705.                has the advantage of being a bit more precise than
  4706.                the ElapsedSeconds method, but requires that you
  4707.                allocate a TTime variable to hold the results.
  4708. GetStartTime   Returns the starting time for the timer.  This is
  4709.                the most recent start, not the first one to start
  4710.                accumulating time.
  4711. GetStopTime    Returns the most recent stopping time.
  4712. ResetTimer     Resets the timer to zero without stopping the
  4713.                timer.  Note that is close to, but not quite, the
  4714.                same as ClearTimer.  If the timer is running when
  4715.                this is called, it will be running when it
  4716.                returns.
  4717. StartTimer     Starts the timer by placing the current system
  4718.                time into the Start record.
  4719. StopTimer      Stops the timer by placing the current system time
  4720.                into the Stop record.
  4721.                
  4722. See Also: TCountdownTimer, TTime record.
  4723.  
  4724.  
  4725. TWordLength type                                        Comm
  4726. Declaration:   TWordLength = 5..8;
  4727.  
  4728.      Defines the length of a word (a single character) as far as
  4729. the UART is concerned.  Typical values for this are either 7 or
  4730. 8.  Most connections to mainframes such as the IBM System/370
  4731. will be done using 7-bit word lengths, while most PC-to-PC
  4732. connections will be done using 8-bit word lengths.
  4733.  
  4734. See Also: SetWordLength.
  4735.  
  4736.  
  4737. UART constants                                          Comm
  4738. Declaration:   (in Const block)
  4739.  
  4740.      Constants used for referencing the various registers of the
  4741. 8250B and compatible UARTs.
  4742.  
  4743. RBR = 0   Receive buffer register; where incoming characters
  4744.           are temporarily stored.
  4745. THR = 0   Transmit holding register; where outgoing
  4746.           characters are temporarily stored.
  4747. DLL = 0   Divisor latch low; low byte of the desired bps
  4748.           rate divisor.
  4749. IER = 1   Interrupt enable register; bit mask to enable or
  4750.           disable UART interrupts.
  4751. DLM = 1   Divisor latch high; high byte of the desired bps
  4752.           rate divisor.
  4753. IIR = 2   Interrupt ID register; tells you what event
  4754.           triggered an interrupt.
  4755. FCR = 2   FIFO control register; on UARTs with FIFOs,
  4756.           controls the internal buffers.
  4757. LCR = 3   Line control register; controls various aspects of
  4758.           the data line.
  4759. MCR = 4   Modem control register; controls various aspects
  4760.           of the modem.
  4761. LSR = 5   Line status register; gives information on the
  4762.           ta line.
  4763. MSR = 6   Modem status register; gives information on the
  4764.           modem.
  4765. SCR = 7   Scratch register; temporary 8-bit holding area.
  4766.  
  4767. See Also: OCW constants.
  4768.  
  4769.  
  4770. Upper                                                   Util
  4771. Declaration:   FUNCTION Upper(Strn: String): String;
  4772.  
  4773.      Converts all lowercase characters in a string to uppercase,
  4774. and returns the resulting string.
  4775.  
  4776. See Also: Lower.
  4777.  
  4778.  
  4779. VSeg                                                    Util
  4780. Declaration:   FUNCTION VSeg: Word;
  4781.  
  4782.      Returns the segment of video memory for the text screen.
  4783. For color displays, this will return the value in SegB000.  For
  4784. monochrome displays it will return the value in SegB800.
  4785.  
  4786. See Also: Color variable.
  4787.  
  4788.  
  4789. WaitForRingTrailer                                      Comm
  4790. Declaration:   PROCEDURE WaitForRingTrailer(PortIdx: Byte);
  4791.  
  4792.      Waits for the Trailing Edge of Ring Indicator bit to go high
  4793. in the modem status register.  This signals that the phone has
  4794. stopped its current ring.
  4795.  
  4796. See Also: LineRinging.
  4797.  
  4798.  
  4799. WordLength                                              Comm
  4800. Declaration:   FUNCTION WordLength(PortIdx: Byte):
  4801.                WordLength;
  4802.  
  4803.      Returns the current word length on the COM port.  This value
  4804. will range from 5 to 8, but will typically be either a 7 or an 8.
  4805.  
  4806. See Also: SetWordLength, TWordLength type.
  4807.  
  4808.  
  4809. XPos                                                    Util
  4810. Declaration:   FUNCTION XPos(SubStrn, Strn: String); Offset:
  4811.                Byte): Byte;
  4812.  
  4813.      Returns the first position at which a substring occurs
  4814. within a larger string, or 0 if no offset occurs.  The offset
  4815. returned is an absolute offset into the string, not a relative
  4816. offset based on the value passed in the Offset variable.
  4817.  
  4818. See Also: System.Pos.
  4819.                                              Appendix A: Glossary
  4820.                                                                  
  4821. bps:  bits per second.  This is a measure of how fast data can be
  4822. sent over a serial connection.  Most non-mainframe connections
  4823. are made at 8 bits, 1 stop bit, no parity.  There is also what's
  4824. known as a start bit, which would then make each character a
  4825. total of 10 bits.  These connections make it easy to convert bps
  4826. directly into cps (characters per second).
  4827.  
  4828. batching:  Sending more than one file at a time over a protocol
  4829. without user intervention between each file.  Ymodem is an
  4830. example of a batching protocol.
  4831.  
  4832. blocking:  One method of transferring a file.  In a blocking
  4833. mode, after each packet of data is sent the sender will wait for
  4834. an acknowledgment that the receiver got the data, and it was
  4835. uncorrupted.  It is slower than streaming since the sender is
  4836. inactive until the receiver responds.
  4837.  
  4838. checksum:  A checksum is a way of checking the integrity of data.
  4839. It is computed by taking the sum of all the data and taking the
  4840. result modulo 256.  The result is always an 8-bit data quantity.
  4841. Checksums are not very reliable because it is very feasible for a
  4842. data hit to corrupt the data in such a way that the checksum is
  4843. still valid.  Xmodem is an example of a protocol that uses a
  4844. checksum for error correction.
  4845.  
  4846. CRC:  cyclical redundancy check.  A CRC is used to check the
  4847. integrity of data.  When a CRC is computed for a block of data,
  4848. and even one bit in that block changes, the CRC will also change.
  4849. CRC is a good way to check for errors when sending data over a
  4850. volatile serial connection, such as a phone line.  CRC's can be
  4851. either 16 or 32 bits in size.  Ymodem makes use of a 16-bit CRC.
  4852.  
  4853. DCD:  Data Carrier Detect.  This is one of the lines on your
  4854. serial port.  When DCD is high, a carrier has been detected.
  4855. This really means that you are connected to some kind of remote
  4856. system, whether it be modem or another computer through a null
  4857. modem connection.
  4858.  
  4859. DTR:  Data Terminal Ready.  One of the lines on your serial port.
  4860. DTR must be high to send and receive data on your serial port.
  4861. Some new modems see a low DTR line as a command to hang the modem
  4862. up, if you were connected.
  4863.  
  4864. emulation:  A set of codes which define how a remote system
  4865. should react to various sequences of characters.  Emulation allow
  4866. a remote system to do things with the screen that normally would
  4867. not be possible using the standard ASCII character set.  VT-100
  4868. is a popular terminal emulation used by mainframes.
  4869.  
  4870. FIFO:  First In, First Out.  A FIFO, also known as a queue, is
  4871. present in the 16550A UART.  This buffer allows the serial port
  4872. to receive characters quicker than the program can retrieve them,
  4873. thus increasing throughput and avoiding overrun errors.
  4874.  
  4875. FOSSIL:  An acronym for Fido-Opus-Seadog Standard Interface
  4876. Layer.  A FOSSIL driver provides more complete serial services
  4877. that replace the standard BIOS serial drivers.  FOSSIL drivers
  4878. are used by a lot of bulletin boards and games, as well as the
  4879. first version of BBSkit.  FOSSIL drivers are limited to only
  4880. 38,400bps.
  4881.  
  4882. host:  The end of a user-to-BBS connection that serves the user.
  4883. For example, when you call a BBS, the system you are using is the
  4884. host.  A mainframe is also the host system when you use its
  4885. resources.
  4886.  
  4887. interrupt-driven:  A method of serial communications which allows
  4888. the program to do other things while waiting for characters to
  4889. arrive at the serial port.  When a character does arrive, the
  4890. program temporarily suspends what it was doing, grabs the
  4891. character, and returns.  Interrupt driven routines allow you to
  4892. operate at 115,200bps.
  4893.  
  4894. modem:  A device which allows you to "talk" to other computers
  4895. all over the world over a standard phone line.  Modem stands for
  4896. "modulation/demodulation".  A modem is almost always required
  4897. equipment for using BBSkit.
  4898.  
  4899. polling:  A method of serial communications which requires that
  4900. the program constantly check, or poll, the serial port for
  4901. incoming characters.  It is very inefficient.
  4902.  
  4903. protocol:  A method of sending files over a serial connection is
  4904. such a way that the receiver ends up getting an exact duplicate
  4905. of the file sent.  Most protocols implement some method of error
  4906. correction to help cut down on the number of errors that
  4907. eventually get through.
  4908.  
  4909. streaming: Another method of transferring a file.  Streaming
  4910. sends each packet of a transfer with little or no waiting between
  4911. packets.  It is more efficient than blocking since it does not
  4912. need to wait on the receiver, but also requires a more advanced
  4913. UART at high speeds.
  4914.  
  4915. terminal program:  A program which allows you to send and receive
  4916. characters, and not much else.  Most terminal programs include
  4917. other bells and whistles, such as transfer protocols.  A terminal
  4918. program is required for communicating with a host.
  4919.  
  4920. UART:  Universal Asynchronous Receiver/Transmitter.  The chip
  4921. that works your serial port, such as the National 16550A.
  4922.  
  4923. Xmodem:  The original protocol developed strictly for 8-bit data
  4924. connections.  Xmodem is found in virtually every popular
  4925. communications application.
  4926.  
  4927. Ymodem:  A more advanced version of Xmodem which includes the
  4928. ability to send more than one file at a time (known as batching),
  4929. more careful error checking, and larger packet sizes.
  4930.  
  4931. Zmodem:  Another file transfer protocol similar to Ymodem, but it
  4932. also has additional features that make it better for file
  4933. transfers across packet switching networks that gobble certain
  4934. characters.  Zmodem also has the ability to resume an aborted
  4935. download through the use of Zmodem Crash Recovery.  Many popular
  4936. terminal programs offer this feature.
  4937.                          Appendix B: Contacting Technical Support
  4938.                                                                  
  4939.      Technical support is available to all registered users free
  4940. of charge from the time that registration is received.  By "free
  4941. of charge" I mean that I will provide as much help as I can in
  4942. any way that I can, so long as it does not cost me lots of money.
  4943. Support is available over the phone (no collect calls will be
  4944. accepted), through United States Mail, through CompuServe,
  4945. through the Internet, or through BITNET.
  4946.      As a college student, my address at school changes with each
  4947. year.  Not only that, but I sometimes go home for a weekend,
  4948. winter break, or spring break.  Since this is something that can
  4949. be a bother to users, I am taking it upon myself to inform
  4950. registered users of my change of address at the beginning of each
  4951. school year.  The address for that school year and the telephone
  4952. number will be provided in a mailing sent to all users through
  4953. U.S. Mail.  Additional information may be included with this
  4954. mailing about technical support.
  4955.  
  4956.      Stable address/phone number info is:
  4957.  
  4958. U.S. Mail (home):   BBSkit Technical Support
  4959.                     1888 Edith Marie Drive
  4960.                     Beavercreek, OH  45431-3377
  4961. CompuServe:         >INTERNET:sjmadsen@miavx1.acs.muohio.edu
  4962. Internet:           sjmadsen@miavx1.acs.muohio.edu
  4963. BITNET:             sjmadsen@miavx1
  4964.  
  4965.      Just about every information service offers some sort of
  4966. gateway to the Internet.  Please check your information or ask a
  4967. system operator on your service about sending and receiving mail
  4968. with the Internet.  Having access such as this makes it much
  4969. easier for you and I to exchange new code, bug fixes, and
  4970. information on the development of BBSkit and associated
  4971. applications in general.
  4972.  
  4973.      As an added convenience, I will accept calls for technical
  4974. support.  As a private developer, there are no hours for
  4975. technical support.  Instead, I would like to simply ask my users
  4976. to call at a reasonable hour.  "Reasonable" is anywhere from 8am
  4977. to 11pm, but remember that I have a "normal" job, too (at least
  4978. during the summer).  The best time to reach me would probably be
  4979. from 6pm to 11pm, east coast time.
  4980.      If for some reason I am not home, please leave a message.
  4981. To make sure that I receive this message, let whoever answers
  4982. know that it is about BBSkit.  That way, I'll see it as soon as I
  4983. get in.  I will return calls for tech support provided that the
  4984. calls don't start costing too much.  However, the most reliable
  4985. method for reaching me for technical support would be through
  4986. some means electronic.  Sending me mail through CompuServe or
  4987. Internet is by far the easiest for both of us.  I check my
  4988. Internet mail on a daily basis, and you never have to worry about
  4989. a busy signal, either.  Additionally, my experience has been that
  4990. debugging BBSkit applications can be tricky, and the best way for
  4991. me to help you with your problem is to actually see the code.  It
  4992. can get very expensive for both of us to try sending code over
  4993. long distance, so including the problematic code in any mail you
  4994. send me (US or electronic) is always a great idea!
  4995.  
  4996.      When calling technical support, please have the following
  4997. information available in the event that it is needed to help
  4998. diagnose your problem:
  4999.  
  5000.        * Version of BBSkit being run  (use VersionID)
  5001.        * Version of Turbo Pascal
  5002.        * Version of DOS
  5003.        * Computer make & model
  5004.        * Modem make & model
  5005.  
  5006.      I will do my best to help you with any problems you may be
  5007. having getting BBSkit to work with your hardware.  However, I
  5008. cannot debug your code for you.  Technical support is primarily a
  5009. means to getting BBSkit to work with your particular hardware
  5010. configuration and making sure that BBSkit is not causing your
  5011. problem.
  5012.  
  5013.      Upgrades to new versions of BBSkit will be very reasonable.
  5014. They will include the new printed manual, new disks, and postage.
  5015. If there isn't a new manual, the cost will be considerably less,
  5016. of course.  When an upgrade is ready for release, registered
  5017. users will receive postcards informing them of the upgrade and
  5018. giving a short list of new features or bug fixes.  Typically, my
  5019. major upgrade schedule has ended up being on a yearly basis.
  5020. Each version of BBSkit usually burns me out for a couple of
  5021. months until the following fall, so new upgrades usually appear
  5022. sometime in the spring or summer.  This isn't set in stone, of
  5023. course, it's just supposed to give you a rough idea of when to
  5024. expect new & exciting things to play with.
  5025.  
  5026.      If you would like to get maintenance releases (identified by
  5027. a letter following the version, such as 2.0g), these can be
  5028. acquired for minimal cost through US Mail or for free if you have
  5029. Internet access or are willing to call a host and download a
  5030. file.  Just call me on my voice line sometime in the evening and
  5031. I'll let you know what's going on.
  5032.  
  5033.  
  5034. Mailing List
  5035.  
  5036.      There is now a BBSkit mailing list for those of you with
  5037. electronic mail access.  This mailing list is currently being run
  5038. off of an original NeXT '030 cube running NeXTSTEP 2.0.  The list
  5039. processor software in use is ListProcessor 6.0b by Anastasios
  5040. Kotsikonas.  UNIX mailing lists work entirely through email,
  5041. provided a kind of conferencing for those unable to access USENET
  5042. newsgroups.  Additionally, the members of these lists are usually
  5043. more interested in the topic at hand, less likely to cause
  5044. trouble, and contribute more to the list.  I would be very happy
  5045. to see you on this list if you have access to Internet mail.
  5046.  
  5047.      You can subscribe to the list by sending a one-line message
  5048. to listproc@nextsrv.cas.muohio.edu of the form:
  5049.  
  5050.           subscribe bbskit [your name]
  5051.  
  5052.      Replace [your name] with your real first & last name, as you
  5053. would like the other members of the list to see it.  Posting a
  5054. message to the list is as simple as composing a mail message to
  5055. an individual.  Simple send the entire message to
  5056. bbskit@nextsrv.cas.muohio.edu and the message will be sent to all
  5057. of the other members of the list.
  5058.  
  5059. ftp site
  5060.  
  5061.      To make life even more wonderful for those of you with
  5062. Internet access, there is also an ftp site which is home to
  5063. BBSkit and applications which make use of it.  ftp to
  5064. ftp.cas.muohio.edu and start looking around in the
  5065. /pub/dos/bbskit directory.  If you have something of interest,
  5066. why not drop it into the incoming/ directory and I can put it up
  5067. for everyone else?  Examples, neat algorithms that others might
  5068. find useful, pretty much anything goes.
  5069.                                     Appendix C: Extended Keycodes
  5070.                                                                  
  5071.  
  5072. AltSpace  = $02     CtrlIns   = $04     ShiftIns  = $05
  5073. CtrlDel   = $06     ShiftDel  = $07     ShiftTab  = $0F
  5074. AltQ      = $10     AltW      = $11     AltE      = $12
  5075. AltR      = $13     AltT      = $14     AltY      = $15
  5076. AltU      = $16     AltI      = $17     AltO      = $18
  5077. AltP      = $19     AltA      = $1E     AltS      = $1F
  5078. AltD      = $20     AltF      = $21     AltG      = $22
  5079. AltH      = $23     AltJ      = $24     AltK      = $25
  5080. AltL      = $26     AltZ      = $2C     AltX      = $2D
  5081. AltC      = $2E     AltV      = $2F     AltB      = $30
  5082. AltN      = $31     AltM      = $32     F1        = $3B
  5083. F2        = $3C     F3        = $3D     F4        = $3E
  5084. F5        = $3F     F6        = $40     F7        = $41
  5085. F8        = $42     F9        = $43     F10       = $44
  5086. Home      = $47     Up        = $48     PgUp      = $49
  5087. Left      = $4B     Right     = $4D     End       = $4F
  5088. Down      = $50     PgDn      = $51     Ins       = $52
  5089. Del       = $53     ShiftF1   = $54     ShiftF2   = $55
  5090. ShiftF3   = $56     ShiftF4   = $57     ShiftF5   = $58
  5091. ShiftF6   = $59     ShiftF7   = $5A     ShiftF8   = $5B
  5092. ShiftF9   = $5C     ShiftF10  = $5D     CtrlF1    = $5E
  5093. CtrlF2    = $5F     CtrlF3    = $60     CtrlF4    = $61
  5094. CtrlF5    = $62     CtrlF6    = $63     CtrlF7    = $64
  5095. CtrlF8    = $65     CtrlF9    = $66     CtrlF10   = $67
  5096. AltF1     = $68     AltF2     = $69     AltF3     = $6A
  5097. AltF4     = $6B     AltF5     = $6C     AltF6     = $6D
  5098. AltF7     = $6E     AltF8     = $6F     AltF9     = $70
  5099. AltF10    = $71     CtrlPrtSc = $72     CtrlLeft  = $73
  5100. CtrlRight = $74     CtrlEnd   = $75     CtrlPgDn  = $76
  5101. CtrlHome  = $77     Alt1      = $78     Alt2      = $79
  5102. Alt3      = $7A     Alt4      = $7B     Alt5      = $7C
  5103. Alt6      = $7D     Alt7      = $7E     Alt8      = $7F
  5104. Alt9      = $80     Alt0      = $81     AltMinus  = $82
  5105. AltEqual  = $83     CtrlPgUp  = $84     AltBack   = $08
  5106.  
  5107.